Codebase maps / expressjs/express

The Express codebase, as a map.

Express is small: its whole library is six files in lib/, and routing lives in a package of its own. Around them sit about two dozen example apps and the tests. Here is what each file does - and the whole repository as a map you can open and explore.

Explore Express in 3D — free →expressjs/express on GitHub
The Express repository as a map: every folder and file, grouped by package

How Express is organized

Express is a fast, unopinionated, minimalist web framework for Node.js. These are the parts of its repository, and what each one does.

lib/express.js

express() itself: createApplication makes a new app. It also hands out express.Router (from the router package), express.static (serve-static) and the body parsers express.json, urlencoded, raw and text (body-parser).

lib/application.js

The app: app.use, app.get and the other HTTP methods, app.route, app.param, settings (app.set, app.enable), app.engine, app.render, and app.listen, which starts the server. Each request is handed to the app's router.

lib/request.js

What Express adds to req: req.get, req.accepts, req.is and req.range, and values like req.query, req.ip, req.hostname, req.path and req.secure.

lib/response.js

What Express adds to res: res.send, res.json, res.status, res.redirect, res.render, res.cookie, res.sendFile, res.download and more.

lib/view.js

How app.render finds a template file in your views folder and hands it to the template engine you chose.

lib/utils.js

Small helpers the rest use: ETags, the query-string parser, the trust proxy setting and content types.

examples/

Small example apps, one idea each: auth, cookies, sessions, downloads, error pages, template engines, route maps, MVC and more.

test/

The tests - a file for each method of app, req and res (res.send.js, req.ip.js...), and acceptance tests that run the examples.

Where to start reading

Open these in the live map - click a file to read it beside the map, and point at it to see what it imports.

  1. index.js - the front door: one line that loads lib/express.js
  2. lib/express.js - what you get when you call express()
  3. lib/application.js - app.use, app.get and app.listen
  4. lib/response.js - res.send and res.json - how a reply is written

Good to know

Is this the official Express repository?

Yes: github.com/expressjs/express, where Express is developed. Its router, body parsers and static file server are separate npm packages (router, body-parser and serve-static) that Express depends on.

Is the map up to date?

The live map reads the repository when you open it, so it always shows the current code. The picture on this page was made on October 29, 2026.

Can I map my own project like this?

Yes. Paste any public GitHub link, or open a folder on your computer - your own code never leaves your device.