Moved ping to its own controller

re: #6281
This commit is contained in:
Julian Lam
2018-01-25 11:50:33 -05:00
parent f7aa32cd05
commit a4939d78fe
4 changed files with 30 additions and 13 deletions

15
src/controllers/ping.js Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
var async = require('async');
var db = require('../database');
module.exports.ping = function (req, res, next) {
async.waterfall([
function (next) {
db.getObject('config', next);
},
function () {
res.status(200).send(req.path === '/sping' ? 'healthy' : '200');
},
], next);
};