Express
Express is the most widely deployed Node.js web framework, providing a minimal, unopinionated layer of routing, middleware, and HTTP utilities on top of the built-in http module. Express defined the middleware pattern that nearly every Node web framework since has adopted.
Core concepts
- Routes. Map HTTP methods and URL paths to handler functions.
- Middleware. Functions of the form
(req, res, next) => voidthat compose into a request pipeline. - Request and response. Augmented Node.js objects with helpers like
res.json(),req.params,req.body. - Routers. Modular sub-applications mounted on path prefixes.
Common middleware
express.json(),express.urlencoded()for body parsingcors,helmet,compressionfor security and performancemorgan,pino-httpfor request loggingexpress-rate-limit,express-validatorfor protection and validation
Alternatives
- Fastify. Higher throughput, schema-driven, growing share.
- Koa. Modern async-first design from the Express authors.
- NestJS. Opinionated, Angular-inspired structure on top of Express or Fastify.
- Hono. Edge-first, runs on Bun, Deno, Cloudflare Workers, Node.
🔗