Fix route health

This commit is contained in:
Aurelsicoko 2017-09-26 17:56:44 +02:00
parent 572c4452f7
commit 16b5056200
3 changed files with 4 additions and 3 deletions

View File

@ -64,4 +64,4 @@
"npm": ">= 3.0.0"
},
"license": "MIT"
}
}

View File

@ -118,4 +118,4 @@
"uglifyjs-webpack-plugin": "^1.0.0-beta.2",
"webpack-bundle-analyzer": "^2.9.0"
}
}
}

View File

@ -148,7 +148,8 @@ class Strapi extends EventEmitter {
async load() {
strapi.app.use(async (ctx, next) => {
if (ctx.request.url === '/_health' && ctx.request.method === 'HEAD') {
ctx.set('strapi', 'heartbeat');
ctx.set('strapi', 'You are so French !');
ctx.set('status', 204);
} else {
await next();
}