resource-router-middleware
resource-router-middleware copied to clipboard
No ability to use private methods inside `route`
Could you please add possibility to use context inside route? Line 27.
router[fn](url, route[key].bind(route));
Seems reasonable. What's the purpose?
I'm curious if anyone was relying on the old context. Likely not..
to make it able to branch request data handling. e.q.:
list(req, res, next) {
let {type} = req.query;
return type === 'some-condition' ? this.doSome1(req, next, title) : this.doSome2(req, next, title);
},
doSome1() {},
doSome2() {},