From ec1b08dcdd36e08567641787b634ca7352b92dca Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 19 May 2017 05:26:26 +0000 Subject: [PATCH] properly bootstraps --- lib/bootstrap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bootstrap.js b/lib/bootstrap.js index 34428e9..5d9bdbd 100644 --- a/lib/bootstrap.js +++ b/lib/bootstrap.js @@ -16,7 +16,7 @@ module.exports.create = function (app, xconfx, models) { // TODO read from file only, not db return models.ComDaplieWalnutConfig.get('config').then(function (conf) { if (!conf || !conf.primaryDomain/* || !conf.primaryEmail*/) { - console.log('DEBUG incomplete conf', conf); + console.log('[DEBUG] uninitialized or incomplete config:', JSON.stringify(conf)); return false; } @@ -155,6 +155,7 @@ module.exports.create = function (app, xconfx, models) { var configpath = path.join(__dirname, '..', '..', 'config', config.domain + '.json'); safeConfig = { primaryDomain: config.domain }; + xconfx.primaryDomain = safeConfig.primaryDomain; return fs.writeFileAsync(configpath, JSON.stringify(safeConfig, null, ' '), 'utf8').then(function () { // TODO nix SQL return models.ComDaplieWalnutConfig.upsert('config', safeConfig);