You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.
I have added a named route and would like to know how will I get the same via request object.
I want to know the name of the route which got matched.
Example:
router({ path: '/user/:id', name: 'user-info' })
.get(function (req, res) {
//Here I am looking for route name which got matched.
res.send(req.route.name);
});
The text was updated successfully, but these errors were encountered:
@tapankumar You can get it using req.baseUrl. We still have access to the same express's Request object as we used to while writing using plain express.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have added a named route and would like to know how will I get the same via request object.
I want to know the name of the route which got matched.
Example:
router({ path: '/user/:id', name: 'user-info' })
.get(function (req, res) {
//Here I am looking for route name which got matched.
res.send(req.route.name);
});
The text was updated successfully, but these errors were encountered: