Skip to content

Commit

Permalink
Fix koa-404 issue by adding res.statusCode to 200 (#815)
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoda authored and impronunciable committed Jan 18, 2017
1 parent c1f2b92 commit 2efabde
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/custom-server-koa/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ app.prepare()
this.respond = false
})

server.use(function *(next) {
// Koa doesn't seems to set the default statusCode.
// So, this middleware does that
this.res.statusCode = 200
yield next
})

server.use(router.routes())
server.listen(3000, (err) => {
if (err) throw err
Expand Down

0 comments on commit 2efabde

Please sign in to comment.