In Express.js, router.route(path) returns a Route for one path on an express.Router() so you can chain HTTP verbs — .get(), .post(), .put(), .delete(), .all(), and more — without repeating the path string.
Official tip: use it to avoid duplicate route names and typos. Matching rules are the same as separate router.METHOD() calls. The path is relative to the mount. The app-level twin is app.route().
Syntax
Call router.route in your Express.js app. Start with this line.
GET /admin/stats (no header)
→ 401 { "error": "unauthorized" }
GET /admin/stats (header x-admin: yes)
→ 200 { "users": 12 }
POST /admin/stats (header x-admin: yes)
→ 201 { "ok": true }
How It Works
Guard once..all checks the header for every verb on /stats.
Deny early. Missing header sends 401 and skips later handlers.
Allow with next(). Valid requests reach .get or .post.
Mount. Public paths are under /admin.
Compatibility
Runtime Support
router.route() is an Express.js router method. It runs on a Node.js server (Express 5 needs Node.js 18+). Browsers only send HTTP requests.
✓ Server · Express 4 & 5
router.route()
Works wherever Express runs: Node.js is the primary target. Bun and Deno can run many Express apps with compatibility layers.
ServerNode.js runtime API
Node.js18+ for Express 5 · 14+ typical for Express 4
Supported
BunExpress-compatible server apps
Supported
DenoVia npm compatibility / adapters
Supported
router.route()Express on Node.js
Bottom line: Study and run these examples with Node.js and the express package. Copy a snippet into a local file and start the server with node.
Frequently Asked Questions
It returns a Route instance for one path on a router so you can chain .get(), .post(), .put(), .delete(), .all(), and other HTTP methods without repeating the path string.
Official reason: avoid duplicate path strings and typo errors. It also keeps related handlers together inside a module.
Same chaining idea. router.route() lives on an express.Router(), so the path is relative to where you mount that router with app.use().
It runs for every HTTP verb on that path first — useful as route-specific middleware before .get() or .post(). It can run even when no matching method handler exists.
No. It is a server-side Express routing helper on Node.js.