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:
parent
c1f2b92a27
commit
2efabde215
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue