Express.js Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. The reference material consulted while preparing these pages is listed in the section bibliography. |
A single-page, colour-coded summary of the Express.js essentials, written against Express 5.3 (5.3.0) and Express 4.22 (4.22.3, maintenance) on Node.js 24 and 26 LTS, with Node.js 18 as the Express 5 minimum (versions verified 2026-10-29) — setup and versions, routing, routers, middleware, body parsing and static files, application settings, the request and response objects, views, errors, APIs and data, security, authentication, testing, production, debugging, and a strip of what changed since older tutorials — handy for quick memorization or as a downloadable PDF desk reference.
For the full explanation, every option, and additional examples, see the dedicated pages:
Start here — Express.js and its Bibliography.
Foundations — Introduction & Architecture, Versions, Support & LTS, Getting Started with Express, TypeScript with Express, and Project Structure and Configuration.
Routing — Routing, Route Paths and Parameters, and Routers & Modular Apps.
Middleware — Middleware Fundamentals, Body Parsing, and Official Middleware Modules.
Application, request & response — Application and Settings, The Request Object (req), Response, and Content Negotiation & HTTP Caching.
Static files & views — Serving Static Files and Template Engines & Views.
Errors, debugging & logging — Error Handling and Debugging and Logging.
APIs & data — Building REST APIs with Express, Validation and Input Handling, Database Integration, MongoDB and Mongoose with Express, and File Uploads and Downloads.
Integrations — GraphQL with Express, Real Time: WebSockets, Socket.IO and Server-Sent Events, and SPAs and Server-Side Rendering.
Security — Security Best Practices, Cookies & Sessions, Authentication & Authorization, and CORS in Express.
Testing — Testing.
Production — Performance Best Practices, Behind Proxies, Health Checks and Graceful Shutdown, and Deployment & Containers.
Migration & beyond — Migrating & What’s Changed, Extending the Express API, and Frameworks Built on Express and Alternatives.