why can't I use async and await in the second middleware?

105 Views Asked by At

I found a demo in the koa-router official docs.

router.get(
  '/users/:id',
  (ctx, next) => {
    //something
  },
  async ctx => {
    //I can't use await here
  }
);

But why can't I use async and await in the second middleware? I always got Not found response by default.

0

There are 0 best solutions below