Express 5 · Routing

Group routes in a router

Put related routes in a router and mount it under a prefix.

const router = express.Router();
router.get("/", (req, res) => res.json([]));

app.use("/users", router);

Official Express 5 documentation

More routing commands

All routing commands · Express 5 cheatsheet

Was this page helpful?