Node.js
Express RoutingExpress Routing
Express routing handles different URL paths and HTTP methods.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
When a user visits your website, they request a specific URL path, like `/about` or `/contact`. Express routing acts like a traffic cop, directing the user's request to the correct block of code based on the URL they typed.
Example
Example
Key Points
- Routes use HTTP methods like GET, POST, PUT, and DELETE.
- `app.get()` retrieves data from the server.
- `app.post()` sends new data to the server.
- The `req` object holds the user's data.