diff --git a/src/controllers/index.js b/src/controllers/index.js index ec23734aec..f62b0e7d10 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -108,7 +108,7 @@ Controllers.search = function(req, res, next) { Controllers.reset = function(req, res, next) { var data = { reset_code: req.params.code ? req.params.code : null - } + }; if (res.locals.isAPI) { res.json(data); diff --git a/src/routes/admin.js b/src/routes/admin.js index fa72013e79..ba383cad84 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -12,12 +12,12 @@ var nconf = require('nconf'), topics = require('./../topics'), pkg = require('./../../package'), categories = require('./../categories'), - meta = require('../meta'), - plugins = require('../plugins'), - widgets = require('../widgets'), + meta = require('./../meta'), + plugins = require('./../plugins'), + widgets = require('./../widgets'), image = require('./../image'), file = require('./../file'), - Languages = require('../languages'), + Languages = require('./../languages'), events = require('./../events'), utils = require('./../../public/src/utils'), templates = require('./../../public/src/templates'); diff --git a/src/routes/authentication.js b/src/routes/authentication.js index f453acbf02..f69bf4e781 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -7,10 +7,10 @@ bcrypt = require('bcryptjs'), winston = require('winston'), - meta = require('../meta'), - user = require('../user'), - plugins = require('../plugins'), - utils = require('../../public/src/utils'), + meta = require('./../meta'), + user = require('./../user'), + plugins = require('./../plugins'), + utils = require('./../../public/src/utils'), templates = require('./../../public/src/templates'), login_strategies = []; diff --git a/src/routes/feeds.js b/src/routes/feeds.js index cf198ea7b2..6d95a69aab 100644 --- a/src/routes/feeds.js +++ b/src/routes/feeds.js @@ -1,14 +1,14 @@ "use strict"; -var posts = require('../posts'), - topics = require('../topics'), - categories = require('../categories'), +var posts = require('./../posts'), + topics = require('./../topics'), + categories = require('./../categories'), rss = require('rss'), nconf = require('nconf'), - ThreadTools = require('../threadTools'), - CategoryTools = require('../categoryTools'); + ThreadTools = require('./../threadTools'), + CategoryTools = require('./../categoryTools'); function hasTopicPrivileges(req, res, next) { var tid = req.params.topic_id; diff --git a/src/routes/meta.js b/src/routes/meta.js index eb25ba31f0..f2d2af8ad6 100644 --- a/src/routes/meta.js +++ b/src/routes/meta.js @@ -4,9 +4,9 @@ var path = require('path'), nconf = require('nconf'), less = require('less'), - meta = require('../meta'), - db = require('../database'), - plugins = require('../plugins'), + meta = require('./../meta'), + db = require('./../database'), + plugins = require('./../plugins'), minificationEnabled = false; diff --git a/src/routes/plugins.js b/src/routes/plugins.js index 040e3c0fe5..7fadbebd98 100644 --- a/src/routes/plugins.js +++ b/src/routes/plugins.js @@ -1,10 +1,10 @@ "use strict"; -var nconf = require('nconf'), +var _ = require('underscore'), + nconf = require('nconf'), path = require('path'), fs = require('fs'), validator = require('validator'), - _ = require('underscore'), async = require('async'), plugins = require('../plugins'); @@ -35,12 +35,12 @@ function setupPluginRoutes(app) { (function(route) { app[routes[route].method || 'get'](routes[route].route, function(req, res) { routes[route].options(req, res, function(options) { - app.build_header({ + /*app.build_header({ req: options.req || req, res: options.res || res }, function (err, header) { //res.send(header + options.content + templates.footer); - }); + });*/ }); }); }(route)); @@ -93,9 +93,9 @@ function setupPluginAdminRoutes(app) { (function(route) { app[routes[route].method || 'get']('/admin' + routes[route].route, function(req, res) { routes[route].options(req, res, function(options) { - Admin.buildHeader(req, res, function (err, header) { + //Admin.buildHeader(req, res, function (err, header) { //res.send(header + options.content + templates['admin/footer']); - }); + //}); }); }); }(route)); diff --git a/src/webserver.js b/src/webserver.js index 0ec1a76b1d..1346ce5452 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -84,12 +84,12 @@ if(nconf.get('ssl')) { module.exports.init = function () { plugins.fireHook('action:app.load', app); - server.on("error", function(e){ - if (e.code === 'EADDRINUSE') { + server.on("error", function(err){ + if (err.code === 'EADDRINUSE') { winston.error('NodeBB address in use, exiting...'); process.exit(1); } else { - throw e; + throw err; } });