expressjs.com icon indicating copy to clipboard operation
expressjs.com copied to clipboard

Document req.route

Open bjohansebas opened this issue 4 months ago • 3 comments

This is a valid API that we need to document. It's accessible through the public API and should therefore follow semver. See: https://github.com/pillarjs/router/blob/cb2a5fcdf31b9cc92296183ceeff8126b5c57453/index.js#L281

Feel free to open a PR for it. Otherwise, I'll take care of it shortly.

https://github.com/pillarjs/router/pull/196#issuecomment-4323308257

bjohansebas avatar Jul 15 '26 19:07 bjohansebas

I checked the repository source and req.route is already documented in src/content/api/3x/, 4x/, and 5x/. This issue can likely be closed!

Prabh0608 avatar Jul 25 '26 09:07 Prabh0608

Haha, yeah. I don't know when it was added, but that's cool. 😄

bjohansebas avatar Aug 02 '26 22:08 bjohansebas

Haha, yeah. I don't know when it was added, but that's cool. 😄

req.route has been documented as something that exists since 07eee0830147e9fcfb7dc211a2b14925fe313a95 (3.x). The problem may be that the returned object is not documented well, except for route[method]() and route.all(). Properties such as path, stack and methods are not documented anywhere (maybe on purpose).

krzysdz avatar Aug 02 '26 22:08 krzysdz