diff --git a/src/routes/admin.js b/src/routes/admin.js index 6124f9beeb..1974c9e52b 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -74,10 +74,6 @@ function miscRoutes(app, middleware, controllers) { module.exports = function(app, middleware, controllers) { - app.all('/api/admin/*', middleware.admin.isAdmin, middleware.prepareAPI); - app.all('/admin/*', middleware.admin.isAdmin); - app.get('/admin', middleware.admin.isAdmin); - mainRoutes(app, middleware, controllers); userRoutes(app, middleware, controllers); forumRoutes(app, middleware, controllers); diff --git a/src/routes/index.js b/src/routes/index.js index ad48f0f580..71deb793df 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -129,6 +129,10 @@ module.exports = function(app, middleware) { app.namespace(nconf.get('relative_path'), function() { plugins.ready(function() { app.all('/api/*', middleware.updateLastOnlineTime, middleware.prepareAPI); + app.all('/api/admin/*', middleware.admin.isAdmin, middleware.prepareAPI); + app.all('/admin/*', middleware.admin.isAdmin); + app.get('/admin', middleware.admin.isAdmin); + plugins.fireHook('action:app.load', app, middleware, controllers); adminRoutes(app, middleware, controllers);