Documenting req.route in relation to route handlers vs middleware #2025
womcauliff
started this conversation in
Content
Replies: 1 comment
-
Same here. Please update the docs, I also wasted a lot of time trying to figure out what's wrong.. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This request for docs comes from expressjs/express#4193, where the person is trying to understanding why
req.route
isundefined
.The answer in response wrote:
I encountered a similar error to the person who raised the issue, and although I understand the high-level differences between middleware and a route handler, it hadn't occurred to me that the shape of the
req
object is different within a route handler vs within a middleware.I believe the docs would benefit by explaining this as explicitly as the responder did in that issue thread.
Beta Was this translation helpful? Give feedback.
All reactions