Express.js
Express.js is a minimal, unopinionated web application framework for Node.js that provides a thin layer of routing, middleware, and HTTP utilities. It is the most widely used Node.js web framework.
§ 1 Definition
Express.js (commonly Express) is a minimalist web framework for Node.js created by TJ Holowaychuk in 2010. It provides a small set of robust features for building web applications and APIs: routing, middleware architecture, request/response handling, static file serving, and template engine integration. Express is unopinionated. It does not dictate project structure, database choice, or authentication strategy. You add exactly what you need via middleware. This flexibility makes Express ideal for projects where you want full control, but it requires discipline to avoid messy codebases. Express is the most popular framework in the Node.js ecosystem and serves as the foundation for NestJS, Gatsby, Sails.js, and many others. Express 5 (released 2024) adds promises for error handling, async middleware support, and path matching improvements.
§ 2 Middleware Architecture
Express is fundamentally a middleware system. Every request passes through a stack of middleware functions in order. Each function can modify the request object, modify the response object, end the request-response cycle, or pass control to the next middleware via next(). Middleware can do anything: logging, parsing JSON, authenticating requests, rate limiting, CORS, compression, serving static files. The middleware pattern makes Express extremely composable. You install and configure only the middleware your application needs. This is why Express is called 'unopinionated' - it provides the pipeline; you decide what goes in it.
§ 3 Routing
Express routing maps HTTP methods and URL patterns to handler functions. Routes support parameterized URLs (/users/:id), query string access, and regular expression patterns. Route handlers are themselves middleware functions, so they can share request context, validate before processing, and handle errors. Express Router (express.Router()) lets you modularize routes into separate files. Modern Express applications typically organize routes by resource (users, posts, products) and use separate router modules for each.
§ 4 Express vs Alternatives
Express faces competition from newer frameworks. Fastify is faster (up to 2x) with built-in schema validation and better developer experience. Hono is ultralight and works across runtimes (Node, Deno, Cloudflare Workers). Koa (by the same creator) uses async middleware natively. Express remains the most popular choice because of its massive ecosystem, overwhelming community support, and the fact that it is good enough for the vast majority of applications. For a greenfield project, evaluate whether you need Express's minimalism or a more feature-rich framework like Fastify or NestJS.
§ 5 Note
§ 6 In code
```javascript
import express from 'express';
const app = express();
// Middleware
app.use(express.json());
// Routes
app.get('/api/users/:id', (req, res) => {
res.json({ id: req.params.id, name: 'Alice' });
});
app.post('/api/users', (req, res) => {
res.status(201).json({ created: true, ...req.body });
});
// Error handling middleware
app.use((err, req, res, next) => {
console.error(err.stack);
res.status(500).json({ error: 'Something broke' });
});
app.listen(3000);
```§ 7 Common questions
- Q. Should I use Express for new projects?
- A. For small to medium APIs, yes. For large enterprise applications, consider NestJS (built on Express with structure) or Fastify (better performance).
- Q. What is the difference between Express 4 and Express 5?
- A. Express 5 adds native async middleware error handling, promises for app.use, improved path matching, and some deprecated API removals. It is a drop-in replacement for most applications.
- Q. Do I need TypeScript with Express?
- A. Strongly recommended for production. TypeScript catches route parameter mismatches, request body shapes, and response types at compile time.
- Express.js is a minimal, unopinionated Node.js web framework focused on routing and middleware.
- Middleware pipeline architecture makes it extremely composable and flexible.
- Express 5 (2024) adds async middleware error handling and promises support.
- The most popular Node.js framework, but faces competition from Fastify, Hono, and NestJS.
Atomic Glue uses Express.js as our standard lightweight API framework for Node.js projects that need full control without framework overhead. We pair it with TypeScript, structured middleware patterns, and rigorous error handling to build production APIs that stay maintainable as they grow. Express is part of our standard toolkit for Web Development services, particularly for microservices, API gateways, and projects where the client wants a lean backend. Get in touch to build your next API.
Get in touchExpress.js is a minimal, unopinionated web application framework for Node.js that provides a thin layer of routing, middleware, and HTTP utilities. It is the most widely used Node.js web framework.
Category: Backend (also: Software Engineering, Front End)
Author: Atomic Glue Development Team
## Definition
Express.js (commonly Express) is a minimalist web framework for Node.js created by TJ Holowaychuk in 2010. It provides a small set of robust features for building web applications and APIs: routing, middleware architecture, request/response handling, static file serving, and template engine integration. Express is unopinionated. It does not dictate project structure, database choice, or authentication strategy. You add exactly what you need via middleware. This flexibility makes Express ideal for projects where you want full control, but it requires discipline to avoid messy codebases. Express is the most popular framework in the Node.js ecosystem and serves as the foundation for NestJS, Gatsby, Sails.js, and many others. Express 5 (released 2024) adds promises for error handling, async middleware support, and path matching improvements.
## Middleware Architecture
Express is fundamentally a middleware system. Every request passes through a stack of middleware functions in order. Each function can modify the request object, modify the response object, end the request-response cycle, or pass control to the next middleware via next(). Middleware can do anything: logging, parsing JSON, authenticating requests, rate limiting, CORS, compression, serving static files. The middleware pattern makes Express extremely composable. You install and configure only the middleware your application needs. This is why Express is called 'unopinionated' - it provides the pipeline; you decide what goes in it.
## Routing
Express routing maps HTTP methods and URL patterns to handler functions. Routes support parameterized URLs (/users/:id), query string access, and regular expression patterns. Route handlers are themselves middleware functions, so they can share request context, validate before processing, and handle errors. Express Router (express.Router()) lets you modularize routes into separate files. Modern Express applications typically organize routes by resource (users, posts, products) and use separate router modules for each.
## Express vs Alternatives
Express faces competition from newer frameworks. Fastify is faster (up to 2x) with built-in schema validation and better developer experience. Hono is ultralight and works across runtimes (Node, Deno, Cloudflare Workers). Koa (by the same creator) uses async middleware natively. Express remains the most popular choice because of its massive ecosystem, overwhelming community support, and the fact that it is good enough for the vast majority of applications. For a greenfield project, evaluate whether you need Express's minimalism or a more feature-rich framework like Fastify or NestJS.
## Note
Common misunderstanding: Express is dead or unmaintained. Express has had slower release cycles (the jump from 4.x to 5.x took over a decade), but it remains actively maintained with regular security updates. Version 5 was released in 2024 and modernized the framework significantly. Another misconception: Express is not production-grade. Express powers massive production systems including MySpace, IBM, and Uber (in parts). Its simplicity is a feature, not a weakness. The real risk with Express is not the framework itself but unstructured code - Express gives you freedom, and freedom requires discipline.
## In code
## Common questions Q: Should I use Express for new projects? A: For small to medium APIs, yes. For large enterprise applications, consider NestJS (built on Express with structure) or Fastify (better performance). Q: What is the difference between Express 4 and Express 5? A: Express 5 adds native async middleware error handling, promises for app.use, improved path matching, and some deprecated API removals. It is a drop-in replacement for most applications. Q: Do I need TypeScript with Express? A: Strongly recommended for production. TypeScript catches route parameter mismatches, request body shapes, and response types at compile time.
## Key takeaways
- Express.js is a minimal, unopinionated Node.js web framework focused on routing and middleware.
- Middleware pipeline architecture makes it extremely composable and flexible.
- Express 5 (2024) adds async middleware error handling and promises support.
- The most popular Node.js framework, but faces competition from Fastify, Hono, and NestJS.
## Related entries
- [Node.js](atomicglue.co/glossary/node-js)
- [REST](atomicglue.co/glossary/rest)
- [Express.js](atomicglue.co/glossary/express-js)
Last updated June 2026. Permalink: atomicglue.co/glossary/express-js