mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
@@ -116,6 +116,7 @@ function initializeNodeBB(callback) {
|
||||
|
||||
function setupExpressApp(app, callback) {
|
||||
var middleware = require('./middleware');
|
||||
var pingController = require('./controllers/ping');
|
||||
|
||||
var relativePath = nconf.get('relative_path');
|
||||
var viewsDir = nconf.get('views_dir');
|
||||
@@ -147,8 +148,8 @@ function setupExpressApp(app, callback) {
|
||||
|
||||
app.use(compression());
|
||||
|
||||
app.get(relativePath + '/ping', ping);
|
||||
app.get(relativePath + '/sping', ping);
|
||||
app.get(relativePath + '/ping', pingController.ping);
|
||||
app.get(relativePath + '/sping', pingController.ping);
|
||||
|
||||
setupFavicon(app);
|
||||
|
||||
@@ -179,17 +180,6 @@ function setupExpressApp(app, callback) {
|
||||
setupAutoLocale(app, callback);
|
||||
}
|
||||
|
||||
function ping(req, res, next) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
db.getObject('config', next);
|
||||
},
|
||||
function () {
|
||||
res.status(200).send(req.path === '/sping' ? 'healthy' : '200');
|
||||
},
|
||||
], next);
|
||||
}
|
||||
|
||||
function setupFavicon(app) {
|
||||
var faviconPath = meta.config['brand:favicon'] || 'favicon.ico';
|
||||
faviconPath = path.join(nconf.get('base_dir'), 'public', faviconPath.replace(/assets\/uploads/, 'uploads'));
|
||||
|
||||
Reference in New Issue
Block a user