You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constn=next({ dev })consthandle=n.getRequestHandler()n.prepare().then(()=>{constapp=newKoa()constrouter=newRouter()router.get('*',asyncctx=>{awaithandle(ctx.req,ctx.res)ctx.respond=false})app.use(async(ctx,next)=>{// Koa doesn't seems to set the default statusCode.// So, this middleware does thatctx.res.statusCode=200awaitnext()})app.use(router.routes())app.listen(3000)})
@timneutkens as Node now has async/await, Koa 2.0.1 was just released 3 days ago 😄 I guess it would make sense to update the example to use this version.
Anyone have a simple example using Koa 2?
The text was updated successfully, but these errors were encountered: