From bf79cc24d5741ee0edec19a17d43e53924cccade Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Wed, 18 Jan 2017 06:59:09 +0530 Subject: [PATCH] Fix koa-404 issue by adding res.statusCode to 200 --- examples/custom-server-koa/server.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/custom-server-koa/server.js b/examples/custom-server-koa/server.js index 0b24e1ed577f4..8091ec371c74d 100644 --- a/examples/custom-server-koa/server.js +++ b/examples/custom-server-koa/server.js @@ -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