It'd be neat to be able to trigger fall-through logic, middleware style.
e.g. attach a handler for /users/:userID that will validate :userID and or hydrate the user info which could be consumed in nested /users/:userID/* routes.
Express's params handler stuff is also kinda neat for centralising this kind of logic: http://expressjs.com/en/4x/api.html#app.param
Basically afaict just some way to toggle whether this is a return or a continue:
|
if (typeof fn !== 'function') return fn |
|
else return fn(params, props) |
Just a thought.
It'd be neat to be able to trigger fall-through logic, middleware style.
e.g. attach a handler for
/users/:userIDthat will validate:userIDand or hydrate the user info which could be consumed in nested/users/:userID/*routes.Express's params handler stuff is also kinda neat for centralising this kind of logic: http://expressjs.com/en/4x/api.html#app.param
Basically afaict just some way to toggle whether this is a
returnor acontinue:enroute/index.js
Lines 32 to 33 in 36300b8
Just a thought.