From 89f550ce7cb4cbfecdf40d73f38c773310784ef7 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 26 Aug 2016 19:40:14 +0300 Subject: [PATCH] moved middleware requires --- src/categories/create.js | 1 - src/webserver.js | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/categories/create.js b/src/categories/create.js index 09df61cb07..fc841679d2 100644 --- a/src/categories/create.js +++ b/src/categories/create.js @@ -3,7 +3,6 @@ var async = require('async'); var db = require('../database'); - var groups = require('../groups'); var plugins = require('../plugins'); var utils = require('../../public/src/utils'); diff --git a/src/webserver.js b/src/webserver.js index ec80bf5f17..68ba499858 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -24,7 +24,6 @@ var meta = require('./meta'); var languages = require('./languages'); var logger = require('./logger'); var plugins = require('./plugins'); -var middleware = require('./middleware'); var routes = require('./routes'); var auth = require('./routes/authentication'); var emitter = require('./emitter'); @@ -83,6 +82,8 @@ module.exports.listen = function() { }; function setupExpressApp(app) { + var middleware = require('./middleware'); + var relativePath = nconf.get('relative_path'); app.engine('tpl', templates.__express); @@ -146,7 +147,9 @@ function setupFavicon(app) { } function initializeNodeBB(callback) { - var skipJS, fromFile = nconf.get('from-file') || ''; + var skipJS; + var fromFile = nconf.get('from-file') || ''; + var middleware = require('./middleware'); if (fromFile.match('js')) { winston.info('[minifier] Minifying client-side JS skipped');