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

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -