1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Fix koa-404 issue by adding res.statusCode to 200 (#815)

This commit is contained in:
Arunoda Susiripala 2017-01-17 19:45:29 -08:00 committed by Dan Zajdband
parent c1f2b92a27
commit 2efabde215

View file

@ -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