From 69f49320f49066fc9d26fde34d049ff16401354b Mon Sep 17 00:00:00 2001 From: Sylvain WITMEYER Date: Wed, 6 Jul 2016 00:51:05 -0400 Subject: [PATCH] Fix conflict with swagger-node-runner 0.1.0 As it seems we can't upgrade swagger-node-runner to 0.6.0, here is a fix for a conflict between swagger-node and the runner You can't define a envvar starting by swagger_ because swagger-node is waiting for a value but the runner is waiting for a JSON. --- config/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/index.js b/config/index.js index c2d978a4..ca705566 100644 --- a/config/index.js +++ b/config/index.js @@ -72,7 +72,11 @@ _.each(process.env, function(value, key) { if (!configItem[subKey]) { configItem[subKey] = {}; } configItem = configItem[subKey]; } else { - configItem[subKey] = value; + try { + configItem[subKey] = JSON.parse(value); + } catch (err) { + configItem[subKey] = value; + } } } debug('loaded env var: %s = %s', split.slice(1).join('.'), value);