req.route is the currently matchedRoute object. Once Express picks a route for the request, this property describes that definition — the pattern you registered, which HTTP methods it handles, and its handler stack.
Use it for logging and debugging (“which route ran?”). For URL data, prefer req.path and req.params. It is set when a route dispatches — not in early global middleware before a match.
Syntax
Read req.route in your Express.js route handler. Start with this line.
Express
req.route // Route object (or undefined)
req.route.path // registered pattern, e.g. '/user/:id'
req.route.methods // { get: true, … }
req.route.stack // handler layers for this route
Call
What it does
req.route // Route object (or undefined)
Primary signature.
req.route.path // registered pattern, e.g. '/user/:id'
Related call form.
req.route.methods // { get: true, … }
Related call form.
req.route.stack // handler layers for this route
Related call form.
Install with npm install express. Create the app with const app = express() before you use this API in an Express.js tutorial project.
This Express.js property is read from the request or response — it has no call parameters.
Return Value
req.route is the currently matched Route object (path template, methods, …) once routing has selected a route. It may be undefined in early middleware.
GET /user/42
Before match, req.route = undefined
→ 200 {
"routePath": "/user/:id",
"path": "/user/42",
"params": { "id": "42" }
}
How It Works
Early middleware first. The top app.use runs before any route — req.route is still undefined.
Then the route matches. The GET /user/:id handler runs with req.route set.
Three different views. Pattern (req.route.path), URL path (req.path), captured values (req.params).
Express 5 note. Optional segments are often written /{:id}; classic /:id still works for required params.
Compatibility
Runtime Support
req.route is an Express.js request property. It runs on a Node.js server (Express 5 needs Node.js 18+). Browsers do not have this API.
✓ Server · Express 4 & 5
req.route
Works wherever Express runs: Node.js is the primary target. Bun and Deno can run many Express apps with compatibility layers. Not available in the browser.
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
req.routeExpress 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 is the currently matched Route object for the request. It exposes the route pattern (path), registered methods, and the handler stack.
Inside a matched route handler (and route-level middleware on that route). Early app.use middleware that runs before a route matches usually does not have it yet.
req.route.path is the route pattern you registered (for example /user/:id). req.path is the actual URL path of this request (for example /user/42).
Usually no. Prefer it for logging, debugging, and metrics. Keep core logic on params, body, and explicit checks.
No. It is a server-side Express property. Browsers only send HTTP requests to your app.