Skip to content

express

Use when building APIs or web servers with Express.js — routing, middleware, error handling, or when working with the most widely-used Node.js HTTP framework. Also use when migrating Express apps or debugging Express-specific issues.

ModelSource
sonnetpack: backend
Full Reference

┏━ 🔧 express ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when building APIs or web servers with Exp… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Express.js is the most widely-used Node.js HTTP framework. Express 5 (stable, default on npm since March 2025) auto-forwards rejected promises to error middleware — no more try/catch boilerplate in async routes.

ItemValue
Current version5.x (stable, latest on npm)
Min Node.jsv18+
Installnpm install express
TypeScript typesnpm install -D @types/express
Key packageshelmet, cors, express-rate-limit, morgan, multer, compression
Docshttps://expressjs.com
I want to…File
Set up a TypeScript Express project from scratchreference/setup.md
Define routes, params, and nested routersreference/routing.md
Add middleware (built-in and custom)reference/middleware.md
Handle errors with custom error classesreference/error-handling.md
Secure with helmet, CORS, rate limiting, and Zodreference/security.md
Implement JWT, session, or OAuth authenticationreference/auth.md
Handle file uploads with multerreference/file-uploads.md
Test routes with supertestreference/testing.md
Optimize with compression, caching, and PM2reference/performance.md
Migrate from Express 4 to Express 5reference/migration.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.