The Express Guide
By Flavio Copes
Express is the classic Node.js web framework. Learn routing, middleware, forms, sessions and building REST APIs with this curated guide.
Express is a web framework for Node.js. It gives you a simple way to handle HTTP requests: define a route, write a function, send a response.
It’s been around forever, and that’s a feature. Express is stable, minimal, and the patterns you learn with it transfer to almost every other backend framework.
This page is your starting point for Express on this site. The posts below take you from your first server to a working REST API.
Where to start
Follow these in order:
- Routing in Express is the core concept: matching URLs to functions
- Send a response using Express covers how to reply to requests
- Send a JSON response using Express is what you’ll do most when building APIs
- Express, Request Parameters shows you everything the request object carries
- Express Middleware explains the pattern the whole framework is built on
Handling input
Reading data from the client, and never trusting it:
- Retrieve the GET query string parameters using Express
- Retrieve the POST query parameters using Express
- Handling forms in Express
- Handling file uploads in forms using Express
- Validating input in Express using express-validator
- Sanitizing input in Express using express-validator
Responses, headers and files
More ways to shape what you send back:
- Work with HTTP headers in Express
- Handling redirects with Express
- Send files using Express
- Serving Static Assets with Express
- Express Templates
State and security
Keeping track of users, and serving your app safely:
- Express Sessions
- Manage Cookies with Express
- Handling CORS in Express
- An Express HTTPS server with a self-signed certificate
- Setup Let’s Encrypt for Express
Build something real
Once the pieces make sense, put them together: Build a REST API using Node.js, Express and MongoDB walks through a complete backend from scratch.
Go deeper
If you want all of this in one structured, readable package, download the free Express Handbook. It covers the framework from setup to production patterns.
Everything I wrote about Express is in the express tag.
Related posts about express: