mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
11
config.json.bk
Normal file
11
config.json.bk
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"url": "http://127.0.0.1:4567",
|
||||||
|
"secret": "catsRkool",
|
||||||
|
"database": "redis",
|
||||||
|
"port": 4567,
|
||||||
|
"redis": {
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": "6379",
|
||||||
|
"database": "0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@ var helpers = require('./helpers');
|
|||||||
|
|
||||||
var Controllers = module.exports;
|
var Controllers = module.exports;
|
||||||
|
|
||||||
|
Controllers.ping = require('./ping');
|
||||||
Controllers.home = require('./home');
|
Controllers.home = require('./home');
|
||||||
Controllers.topics = require('./topics');
|
Controllers.topics = require('./topics');
|
||||||
Controllers.posts = require('./posts');
|
Controllers.posts = require('./posts');
|
||||||
|
|||||||
15
src/controllers/ping.js
Normal file
15
src/controllers/ping.js
Normal 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);
|
||||||
|
};
|
||||||
@@ -116,6 +116,7 @@ function initializeNodeBB(callback) {
|
|||||||
|
|
||||||
function setupExpressApp(app, callback) {
|
function setupExpressApp(app, callback) {
|
||||||
var middleware = require('./middleware');
|
var middleware = require('./middleware');
|
||||||
|
var pingController = require('./controllers/ping');
|
||||||
|
|
||||||
var relativePath = nconf.get('relative_path');
|
var relativePath = nconf.get('relative_path');
|
||||||
var viewsDir = nconf.get('views_dir');
|
var viewsDir = nconf.get('views_dir');
|
||||||
@@ -147,8 +148,8 @@ function setupExpressApp(app, callback) {
|
|||||||
|
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
|
|
||||||
app.get(relativePath + '/ping', ping);
|
app.get(relativePath + '/ping', pingController.ping);
|
||||||
app.get(relativePath + '/sping', ping);
|
app.get(relativePath + '/sping', pingController.ping);
|
||||||
|
|
||||||
setupFavicon(app);
|
setupFavicon(app);
|
||||||
|
|
||||||
@@ -179,17 +180,6 @@ function setupExpressApp(app, callback) {
|
|||||||
setupAutoLocale(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) {
|
function setupFavicon(app) {
|
||||||
var faviconPath = meta.config['brand:favicon'] || 'favicon.ico';
|
var faviconPath = meta.config['brand:favicon'] || 'favicon.ico';
|
||||||
faviconPath = path.join(nconf.get('base_dir'), 'public', faviconPath.replace(/assets\/uploads/, 'uploads'));
|
faviconPath = path.join(nconf.get('base_dir'), 'public', faviconPath.replace(/assets\/uploads/, 'uploads'));
|
||||||
|
|||||||
Reference in New Issue
Block a user