Modern File-Based Routing for Express.js
Next-generation developer experience combining Express performance, intuitive template engines, cascading middlewares, and zero-config API routes.
Quick Installation
Scaffold a new project in seconds with your preferred package manager.
$pnpmcreate nxpress-app@latest my-app
01
Overview & CLI
Nxpress is an Express.js-based framework for Node.js providing file-based routing, template components, cascading middlewares, automatic response handling, and built-in template helpers.
Project Scaffolding (create-nxpress-app)
Scaffold a new ready-to-run Nxpress project interactively or with automated flags.
Quick Start
# Interactive wizard
pnpm create nxpress-app my-app
# or
npx create-nxpress-app my-app
# Bypass prompts with defaults (-y / --yes)
pnpm create nxpress-app my-app -y
# Scaffold API-only project without template views (--api)
pnpm create nxpress-app my-api -y --api| Option / Flag | Description | Default |
|---|---|---|
| -y, --yes | Skip interactive prompts and use defaults | false |
| --api | Scaffold API-only project with users and health routes | false |
| -e, --engine <engine> | Template engine (ejs, handlebars, nunjucks, liquid, html) | ejs |
| -p, --port <number> | HTTP server port number | 3000 |
| --tailwind | Include Tailwind CSS v4 support | true |
| -m, --minimal | Create minimal project without views or components | false |
| --app-dir <dir> | Routes directory name | app |
| --components-dir <dir> | Components directory name | components |
| --public-dir <dir> | Static public assets directory name | public |
| --pkg-manager <pm> | Package manager (pnpm, npm, yarn, bun, deno) | pnpm |
Starting the Server
You can start your Nxpress application in two ways: via the Nxpress CLI or through a custom server.ts entrypoint.
Option 1: Nxpress CLI
# Start development server with Hot Reload, route scanning, & Tailwind
nxpress dev
# or shortcut
nxp dev
# List all generated routes (inspect endpoints, methods, files & debug routing bugs)
nxpress routes
# Start production server
nxpress start
# Generate static HTML export (SSG) to out/
nxpress exportOption 2: Custom server.ts Entrypoint
# Execute server.ts directly using tsx
npx tsx --watch server.ts
# or using pnpm
pnpm serve