From 6e4357c6df01ad9a829cf08b4106f593532b8bff Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Fri, 11 Mar 2016 09:42:33 -0500 Subject: [PATCH] =?UTF-8?q?Adds=20support=20for=20apps=20key=20in=20config?= =?UTF-8?q?=20file,=20throws=20if=20length=20is=20>=C2=A01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/parse-server.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cli/parse-server.js b/src/cli/parse-server.js index b4cbbb12..0ad92a33 100755 --- a/src/cli/parse-server.js +++ b/src/cli/parse-server.js @@ -38,7 +38,15 @@ let options = {}; if (program.args.length > 0 ) { let jsonPath = program.args[0]; jsonPath = path.resolve(jsonPath); - options = require(jsonPath); + let jsonConfig = require(jsonPath); + if (jsonConfig.apps) { + if (jsonConfig.apps.length > 1) { + throw 'Multiple apps are not supported'; + } + options = jsonConfig.apps[0]; + } else { + options = jsonConfig; + } console.log(`Configuation loaded from ${jsonPath}`) }