mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
moving pluginRoutes to top of route stack (like others), put app.load hook behind plugins' ready callback
This commit is contained in:
@@ -309,7 +309,7 @@ var fs = require('fs'),
|
||||
hookList = Plugins.loadedHooks[hook];
|
||||
|
||||
if (hookList && Array.isArray(hookList)) {
|
||||
//if (global.env === 'development') winston.info('[plugins] Firing hook: \'' + hook + '\'');
|
||||
// if (global.env === 'development') winston.info('[plugins] Firing hook: \'' + hook + '\'');
|
||||
var hookType = hook.split(':')[0];
|
||||
switch (hookType) {
|
||||
case 'filter':
|
||||
|
||||
@@ -18,6 +18,7 @@ module.exports = function(app, middleware) {
|
||||
metaRoutes(app, middleware, controllers);
|
||||
apiRoutes(app, middleware, controllers);
|
||||
feedRoutes(app, middleware, controllers);
|
||||
pluginRoutes(app, middleware, controllers);
|
||||
|
||||
/**
|
||||
* Every view has an associated API route.
|
||||
@@ -121,8 +122,9 @@ module.exports = function(app, middleware) {
|
||||
app.get('/users/search', middleware.buildHeader, middleware.checkGlobalPrivacySettings, controllers.users.getUsersForSearch);
|
||||
app.get('/api/users/search', middleware.checkGlobalPrivacySettings, controllers.users.getUsersForSearch);
|
||||
|
||||
pluginRoutes(app, middleware, controllers);
|
||||
plugins.ready(function() {
|
||||
plugins.fireHook('action:app.load', app, middleware, controllers);
|
||||
});
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
require('./debug')(app, middleware, controllers);
|
||||
|
||||
Reference in New Issue
Block a user