koa-router-interceptor
when using koa-router@next ,only regular expression is not enough
to handle dynamic router situation。
this koa-router-interceptor module is to make koa-router more flexible
interceptor should return a true value to handle koa-router logic.
if boolean==true is not returned or resolved, koa-router-interceptor automatically
call next koa middleware for you
install
npm install koa-router-interceptor
soure code
usage case
const http = ; const Koa = ; const app = ; const KoaRouter = ; const KoaRouterInterceptor = ; KoaRouter app; http
changelog
v1.0.4 ==> simplify logic with Promise
notice
it is strongly recommended to use node >=6.0