From 0a8a61adece87b30e7635cd69a1ff8eef3839e0b Mon Sep 17 00:00:00 2001 From: Darren Date: Fri, 9 Nov 2012 16:24:36 +0000 Subject: [PATCH] Server: Default config options during build --- client/assets/dev/build.js | 2 +- server/configuration.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/assets/dev/build.js b/client/assets/dev/build.js index 698bbb9..5fc84a2 100644 --- a/client/assets/dev/build.js +++ b/client/assets/dev/build.js @@ -83,7 +83,7 @@ console.log('kiwi.js and kiwi.min.js built'); var index_src = fs.readFileSync(__dirname + '/index.html.tmpl', FILE_ENCODING); var vars = { - base_path: config.get().http_base_path, + base_path: config.get().http_base_path || '/kiwi', cache_buster: Math.ceil(Math.random() * 9000).toString(), server_settings: '{}', client_plugins: '[]' diff --git a/server/configuration.js b/server/configuration.js index b913db6..02961ca 100644 --- a/server/configuration.js +++ b/server/configuration.js @@ -37,7 +37,7 @@ function loadConfig() { if (new_config) { loaded_config = new_config; - global.config = new_config[environment]; + global.config = new_config[environment] || {}; return loaded_config; } else { return false; @@ -54,7 +54,7 @@ module.exports.setEnvironment = function (new_environment) { module.exports.get = function (specific_environment) { specific_environment = specific_environment || environment; - return loaded_config[specific_environment]; + return loaded_config[specific_environment] || {}; }; module.exports.loadConfig = loadConfig; \ No newline at end of file -- 2.25.1