Express
The most popular minimal web framework for Node.js. Express handles routing, middleware, and HTTP requests/responses. Simple, unopinionated, and the basis for many other frameworks. The default choice for Node.js APIs for years, now often replaced by Fastify or Next.js API routes.
TJ Holowaychuk · Created Express.js in 2010
- Simple Node.js APIs.
- Learning backend concepts.
- Legacy Node.js codebases.
- New high-performance APIs (use Fastify).
- Full-stack apps (use Next.js API routes).
- TypeScript-heavy projects (Fastify has better TS support).
Definition
Express is a minimal, flexible Node.js web framework. It provides routing (app.get/post), middleware (functions that run on each request), and request/response handling. Unopinionated — you choose your own database, auth, structure. The standard for Node.js servers for a decade.
Why it exists
Raw Node.js HTTP is verbose. Express adds routing, middleware, and helpers with minimal overhead, letting you build APIs and web apps quickly.
How it works
Create an app, define routes (app.get('/users', handler)), add middleware (app.use(bodyParser)). Each request passes through middleware chain to the route handler. Handlers receive req/res and call res.send/json. Listen on a port.
Scaling limits
Callback-based (older style, though promises work). No built-in validation/schema (add Zod/Joi). Single-threaded (Node.js limitation). Slower than Fastify. No built-in TypeScript types (need @types/express).
Cost shape
Free and open source.
Alternatives
- Fastify — Faster, better TypeScript, schema validation built-in.
- Next.js API routes — Colocated with frontend, but less flexible.
Failure modes
- Unhandled promise rejections crashing the server.
- Missing error middleware.
- Callback-style code (use async/await).