koa - How to apply middleware to all routes? -
how want apply middleware paths in koa-route, e.g.
router1.use( (ctx) => { console.error("hello 0 ..."); console.log(ctx.url); } router1.all( (ctx) => { console.error("hello 0 ..."); console.log(ctx.url); }
it comes path += str.slice(index, offset) ^
typeerror: str.slice not function hints ? thanks!
i hope it,
router1.use(/(.*)/, (ctx) => { console.error("hello 0 ..."); console.log(ctx.url); }
Comments
Post a Comment