From d8cb9211763236215e418fa46883c2b0c04199a6 Mon Sep 17 00:00:00 2001 From: aurieh <auriteh@gmail.com> Date: Tue, 27 Dec 2016 19:16:27 +0200 Subject: [PATCH] Remove things --- index.js | 4 ++-- routes/freshclam.js | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 5294bf7..1b36498 100644 --- a/index.js +++ b/index.js @@ -72,8 +72,8 @@ app.use(route.get('/freshclam', require('./routes/freshclam.js'))); * Return a 200 OK response, so that Elastic Beanstalk can check if the server * is still online. */ -app.use(route.get('/health', (req, res, next) => { - res.status(200).end(); +app.use(route.get('/health', () => { + this.status = 200; })); // Listen on 8080 diff --git a/routes/freshclam.js b/routes/freshclam.js index a0b952a..0208923 100644 --- a/routes/freshclam.js +++ b/routes/freshclam.js @@ -5,16 +5,12 @@ const freshClam = require('../lib/freshclam.js'); * > GET /freshclam * Run freshclam to update the virus database. */ -module.exports = function* freshclam(next) { +module.exports = function* freshclam() { freshClam().then(() => { - this.body = null; this.status = 200; - yield; }).catch(err => { console.error('failed to update virus definitions'); console.error(err); - this.body = null; this.status = 500; - yield; }); } -- GitLab