Express (Node.js)
Express is the most popular web framework for Node.js. It adds simple routing, middleware, and request/response helpers on top of the built-in http module, making it fast to build APIs and web servers.
Node.js
Express turns Node's low-level http module into a productive framework. You create an app with express(), define routes with app.get('/path', handler), and add cross-cutting behavior with middleware via app.use(). It handles the tedious parts — routing, parsing, response helpers — so you focus on your logic.
Its core ideas are routing (mapping method + path to a handler that gets req and res), middleware (functions that run in order on each request and can modify req/res or end the response), and response helpers like res.json(data), res.status(404), and res.send(). The Router object groups related routes into modules.
Express is minimal and unopinionated, leaving choices like database and structure to you, which is both its strength and its learning curve. It is the default starting point for Node web APIs; alternatives include Fastify (faster, schema-first), Koa, and NestJS (structured).
Syntax
const app = express();
app.get("/", (req, res) => res.send("hi"));Examples
JavaScript
const express = require("express");
const app = express();
app.get("/", (req, res) => res.send("Hello"));
app.get("/api/users", (req, res) => res.json([{ id: 1 }]));
app.listen(3000, () => console.log("on :3000"));