diff --git a/cmd/cmd_controller.js b/cmd/cmd_controller.js index 25386886..0426cbd0 100644 --- a/cmd/cmd_controller.js +++ b/cmd/cmd_controller.js @@ -154,11 +154,8 @@ class EmbarkController { engine.events.emit("status", __("Ready").green); }); - if (options.runWebserver) { - engine.startService("webServer", { - host: options.serverHost, - port: options.serverPort - }); + if (webServerConfig.enabled !== false) { + engine.startService("webServer"); } engine.startService("fileWatcher"); callback(); diff --git a/lib/core/engine.js b/lib/core/engine.js index 249b0afc..671dc7e5 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -226,9 +226,8 @@ class Engine { this.watch.start(); } - webServerService(_options) { - _options.buildDir = this.config.buildDir; - this.registerModule('webserver', _options); + webServerService() { + this.registerModule('webserver'); } storageService(_options) { diff --git a/lib/modules/webserver/index.js b/lib/modules/webserver/index.js index cb2bd502..daa1bbe9 100644 --- a/lib/modules/webserver/index.js +++ b/lib/modules/webserver/index.js @@ -10,18 +10,16 @@ const Templates = { }; class WebServer { - constructor(embark, options) { + constructor(embark) { this.embark = embark; this.logger = embark.logger; this.events = embark.events; - this.buildDir = options.buildDir; + this.buildDir = embark.config.buildDir; this.webServerConfig = embark.config.webServerConfig; if (!this.webServerConfig.enabled) { return; } - this.host = options.host || this.webServerConfig.host; - this.port = options.port || this.webServerConfig.port; this.events.emit("status", __("Starting Server"));