Back to Expressjs

Req Path

_includes/api/en/5x/req-path.md

latest340 B
Original Source
<h3 id='req.path'>req.path</h3>

Contains the path part of the request URL.

js
// example.com/users?sort=desc
console.dir(req.path)
// => "/users"
<div class="doc-box doc-info" markdown="1"> When called from a middleware, the mount point is not included in `req.path`. See [app.use()](/5x/api.html#app.use) for more details. </div>