diff --git a/lib/routes.js b/lib/routes.js index a7d89154a7..66206416dd 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -1,7 +1,18 @@ +var knex = require('./dbPool'); +var logger = require('./logger'); + module.exports = function (app) { app.get('/health', function (req, res) { - res.json({health: 'GOOD'}); + knex.select(1) + .from('features') + .then(function() { + res.json({health: 'GOOD'}); + }) + .catch(function(err) { + logger.error('Could not select from features, error was: ', err); + res.status(500).json({health: 'BAD'}); + }); }); -}; \ No newline at end of file +};