Closed abovedave closed 3 years ago
For a given middleware:
const Middleware = function (app) { app.use('/foo/:bar', (req, res, next, refresh) => { return res.end(req.params.bar) }) } module.exports = function (app) { return new Middleware(app) } module.exports.Middleware = Middleware
When I visit the url /foo/helloworld, I expect helloworld to be accessible by using req.params.bar.
/foo/helloworld
helloworld
req.params.bar
Instead I can see an empty params object in the req object.
req
params: {}, paths: [ '/verify/:token' ]
I think this might be because the middleware routes don't get added to the paths array in api/index.js, and indeed probably never go through controller/router.js where the params are bundled into the request
paths
For a given middleware:
When I visit the url
/foo/helloworld
, I expecthelloworld
to be accessible by usingreq.params.bar
.Instead I can see an empty params object in the
req
object.