The Most-Used Node Web Framework
Express Intro
Express is a thin layer over node:http. Routes, middleware, helpers — the core of most Node APIs in the wild.
What you'll learn
- Install Express
- Build a server in 10 lines
- Know what to learn next
Express is the most popular Node web framework — a thin layer
over node:http that adds routing, middleware, and helpers. Most
Node APIs in production use it (or a descendant).
Install
npm install express Hello, Express
import express from "express";
const app = express();
app.get("/", (req, res) => {
res.send("Hello, Express!");
});
app.get("/api/users", (req, res) => {
res.json([{ id: 1, name: "Ada" }]);
});
app.listen(3000, () => console.log("up on :3000")); Compare with raw node:http:
app.get(path, handler)instead of method/URL switchesres.send()andres.json()instead of manualwriteHead/endapp.use(...)for middleware
What Express Gives You
- Pattern-based routing (
/users/:id) - Middleware chain (auth, logging, body-parsing, error handling)
req.params,req.query,req.body(with body-parser middleware)res.json,res.status,res.redirect,res.cookie- A vast plugin ecosystem (auth, CORS, validation, sessions, …)
What Express Doesn’t Give You
- Type safety (it’s plain JS — for TS, write your own types)
- Built-in validation (use Zod or Joi)
- Performance crown (Fastify is faster)
- Modern features (Server-Sent Events, HTTP/2 streams)
For greenfield projects in 2026, consider Fastify or Hono — faster, schema-first, modern. But Express still dominates job postings, docs, and Stack Overflow answers. Learning it pays off.
Versions
Express 4 has been the standard for a decade. Express 5 went stable recently — drops some legacy quirks, adds promise-aware error handling. This track uses Express 5 patterns; everything also works on 4.
Up Next
Routes — Express’s bread and butter.
Routing →