From c360975e8f445e4d12b613db379ae8003cd5c3a1 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Mon, 17 Sep 2018 17:51:46 -0500 Subject: [PATCH] webServer svc doesn't need to handle cli opts (handled in core/config) --- cmd/cmd_controller.js | 7 ++----- lib/core/engine.js | 5 ++--- lib/modules/webserver/index.js | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/cmd/cmd_controller.js b/cmd/cmd_controller.js index 25386886b..0426cbd09 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 249b0afc3..671dc7e50 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 cb2bd5024..daa1bbe96 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"));