mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
moved plugin route reloading outside of plugin initialisation, so plugins can add a hook listener before core routes have been added
This commit is contained in:
@@ -55,10 +55,21 @@ if(nconf.get('ssl')) {
|
||||
async.apply(!skipLess ? meta.css.minify : meta.css.getFromFile),
|
||||
async.apply(meta.sounds.init)
|
||||
]);
|
||||
|
||||
plugins.fireHook('static:app.preload', {
|
||||
app: app,
|
||||
middleware: middleware
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
return winston.error('[plugins] Encountered error while executing pre-router plugins hooks: ' + err.message);
|
||||
}
|
||||
|
||||
routes(app, middleware);
|
||||
});
|
||||
});
|
||||
|
||||
middleware = middleware(app);
|
||||
routes(app, middleware);
|
||||
plugins.init(app, middleware);
|
||||
|
||||
// Load server-side template helpers
|
||||
helpers.register();
|
||||
|
||||
Reference in New Issue
Block a user