Skip to content

Node.js based forum software built for the modern web

fix tests

barisusakli3ad3e781f359
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);