Smile Gh
Smile Gh

Reputation: 1

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

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.

Upvotes: 0

Views: 105

Answers (0)

Related Questions