Routing

Routing associates an HTTP method and a URL path with a function that handles the request. It can extract parameters from the path (for example an identifier), and returns 404 if no route matches or 405 if the method is not allowed.

Example

app.get('/clients/:id', (req, res) => res.json({ id: req.params.id }));

Related concepts

The whole glossary