Updated Jun 23, 2026

Express From Zero

Express is the framework that defined what a Node.js backend looks like. It's deliberately tiny — a thin layer over Node's built-in HTTP server — and that minimalism is its whole identity: Express gives you routing and a middleware system, and leaves everything else (body parsing, auth, validation, templating) to middleware you add. A decade-plus of Node tutorials, jobs, and production apps run on it, so even as newer frameworks appear, Express is the one you're most likely to meet and the clearest lens on how Node web servers work.

The mental model is one idea repeated everywhere: the middleware chain. A request enters and flows through an ordered series of functions, each with the shape (req, res, next). Each one can read or change the request, send a response, or call next() to pass control to the next function. Routes are just middleware bound to a method and path; error handlers are middleware with an extra argument. Hold "an Express app is a pipeline of (req, res, next) functions," and the entire framework — routing, parsing, auth, errors — is the same shape in different costumes.

📝 This teaches the framework — it assumes you know JavaScript: functions, callbacks, promises, async/await, and modules (JavaScript From Zero). It pairs with What a Framework Even Is, and the node:http roots guide shows exactly what Express wraps. Compare it with Fastify and NestJS. Express runs on Node, so examples are shown with the commands to run them.

How to read this

Read in order — it grows one service (a small tasks API) from a single route to a structured, tested, deployable REST API. Phases carry difficulty badges.

The phases

Part 1 — The core (🟢 Basic)

  1. What Express Is & Your First Server 🟢 — the app, a route, and a running server in a few lines.
  2. Routing 🟢 — methods, route params, query strings, and routers.
  3. Middleware 🟡 — the (req, res, next) chain, ordering, and built-in + third-party middleware.

Part 2 — A real API (🟡 → 🔴) 4. Request & Response 🟡 — reading the body/params, res.json/status, and validation. 5. Building a REST API 🟡 — full CRUD wired through routes and middleware. 6. Error Handling 🔴 — the error-handling middleware, async errors, and one consistent shape.

Part 3 — Ship it (🟡 → 🟢) 7. Serving & Structuring an App 🟡 — static files, structure beyond one file, and config. 8. Testing & Production 🟡 — supertest, environment config, and deployment. 9. Where to Go Next 🟢 — Express vs Fastify/NestJS, the ecosystem, and what to build.

The throughline: an Express app is a chain of (req, res, next) functions — routes, parsers, auth, and error handlers are all that one shape. Hold it and Express is a small tool you fully understand.


Phase 1: What Express Is & Your First Server →