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

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -