From 73275d760f9d2fe2d9456109ffba8a0500c32553 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 2 Jan 2014 20:27:09 +0000 Subject: [PATCH] Move config path.update to config.load issue #1789 - we can do this step a bit earlier and it aids with neatness - also means for tests that config.load() is enough to get config & paths initialised --- core/server/config/index.js | 6 +++++- core/server/index.js | 9 +++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/server/config/index.js b/core/server/config/index.js index e286c006a8..798741edca 100644 --- a/core/server/config/index.js +++ b/core/server/config/index.js @@ -21,9 +21,13 @@ function loadConfig() { return loader().then(function (config) { // Cache the config.js object's environment // object so we can later refer to it. - // Note: this is not the entirity of config.js, + // Note: this is not the entirety of config.js, // just the object appropriate for this NODE_ENV ghostConfig = config; + + // can't load theme settings yet as we don't have the API, + // but we can load the paths + return paths.update(config.url); }); } diff --git a/core/server/index.js b/core/server/index.js index a215c3dd54..050154cea0 100644 --- a/core/server/index.js +++ b/core/server/index.js @@ -87,12 +87,9 @@ function setup(server) { Polyglot.instance = new Polyglot(); // ### Initialisation - when.join( - // Initialise the models - models.init(), - // Calculate paths - config.paths.update(config().url) - ).then(function () { + + // Initialise the models + models.init().then(function () { // Populate any missing default settings return models.Settings.populateDefaults(); }).then(function () {