mirror of https://github.com/embarklabs/embark.git
don't forward host/port cli options if the options weren't specified
This commit is contained in:
parent
aa806ce400
commit
21b4cbf60d
17
lib/index.js
17
lib/index.js
|
@ -61,6 +61,17 @@ class Embark {
|
||||||
self.context = options.context || [constants.contexts.run, constants.contexts.build];
|
self.context = options.context || [constants.contexts.run, constants.contexts.build];
|
||||||
let Dashboard = require('./dashboard/dashboard.js');
|
let Dashboard = require('./dashboard/dashboard.js');
|
||||||
|
|
||||||
|
let webServerConfig = {
|
||||||
|
enabled: options.runWebserver
|
||||||
|
};
|
||||||
|
|
||||||
|
if (options.serverHost) {
|
||||||
|
webServerConfig.host = options.serverHost;
|
||||||
|
}
|
||||||
|
if (options.serverPort) {
|
||||||
|
webServerConfig.port = options.serverPort;
|
||||||
|
}
|
||||||
|
|
||||||
const Engine = require('./core/engine.js');
|
const Engine = require('./core/engine.js');
|
||||||
const engine = new Engine({
|
const engine = new Engine({
|
||||||
env: options.env,
|
env: options.env,
|
||||||
|
@ -72,11 +83,7 @@ class Embark {
|
||||||
logLevel: options.logLevel,
|
logLevel: options.logLevel,
|
||||||
context: self.context,
|
context: self.context,
|
||||||
useDashboard: options.useDashboard,
|
useDashboard: options.useDashboard,
|
||||||
webServerConfig: {
|
webServerConfig: webServerConfig
|
||||||
enabled: options.runWebserver,
|
|
||||||
host: options.serverHost,
|
|
||||||
port: options.serverPort
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
engine.init();
|
engine.init();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue