express-capture-route
Capture route definitions, and reconstruct the original route.
Wrap your Router
and express()
calls in capture
, and it will
annotate the objects such that it can recover the original path,
through multiple layers of router
and mounted sub-apps.
Example
See also examples/readme.ts: npm run example
;;;router.get'/foo/:bar', foo; ;app.usesomeMiddleWare;captureapp.use'/api', router; recoverFromHandlerfoo.path === ; // or, with some `onFinished` middlewareapp.use;