From 3ad3e781f3594ad6a455b3377f5fafa3894162c7 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 3 Dec 2014 01:49:57 -0500 Subject: [PATCH] fix tests --- app.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app.js b/app.js index 8d8c06ed88..446b0f7c42 100644 --- a/app.js +++ b/app.js @@ -98,6 +98,15 @@ function loadConfig() { views_dir: path.join(__dirname, 'public/templates') }); + // Ensure themes_path is a full filepath + nconf.set('themes_path', path.resolve(__dirname, nconf.get('themes_path'))); + nconf.set('core_templates_path', path.join(__dirname, 'src/views')); + nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-vanilla/templates')); +} + +function start() { + loadConfig(); + // nconf defaults, if not set in config if (!nconf.get('upload_path')) { nconf.set('upload_path', '/public/uploads'); @@ -110,16 +119,6 @@ function loadConfig() { nconf.set('port', urlObject.port || nconf.get('port') || nconf.get('PORT') || 4567); nconf.set('upload_url', relativePath + '/uploads/'); - - // Ensure themes_path is a full filepath - nconf.set('themes_path', path.resolve(__dirname, nconf.get('themes_path'))); - nconf.set('core_templates_path', path.join(__dirname, 'src/views')); - nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-vanilla/templates')); -} - -function start() { - loadConfig(); - if (!cluster.isWorker || process.env.cluster_setup === 'true') { winston.info('Time: %s', (new Date()).toString()); winston.info('Initializing NodeBB v%s', pkg.version);