mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
wait for all routes to load before listening
This commit is contained in:
@@ -127,7 +127,6 @@ var middleware;
|
||||
};
|
||||
|
||||
Plugins.reloadRoutes = function (callback) {
|
||||
callback = callback || function () {};
|
||||
var router = express.Router();
|
||||
|
||||
router.hotswapId = 'plugins';
|
||||
@@ -138,7 +137,8 @@ var middleware;
|
||||
var controllers = require('./controllers');
|
||||
Plugins.fireHook('static:app.load', { app: app, router: router, middleware: middleware, controllers: controllers }, function (err) {
|
||||
if (err) {
|
||||
return winston.error('[plugins] Encountered error while executing post-router plugins hooks: ' + err.message);
|
||||
winston.error('[plugins] Encountered error while executing post-router plugins hooks: ' + err.message);
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
hotswap.replace('plugins', router);
|
||||
|
||||
Reference in New Issue
Block a user