webServer svc doesn't need to handle cli opts (handled in core/config)

This commit is contained in:
Michael Bradley, Jr 2018-09-17 17:51:46 -05:00
parent 2b5268dc84
commit c360975e8f
3 changed files with 6 additions and 12 deletions

View File

@ -154,11 +154,8 @@ class EmbarkController {
engine.events.emit("status", __("Ready").green); engine.events.emit("status", __("Ready").green);
}); });
if (options.runWebserver) { if (webServerConfig.enabled !== false) {
engine.startService("webServer", { engine.startService("webServer");
host: options.serverHost,
port: options.serverPort
});
} }
engine.startService("fileWatcher"); engine.startService("fileWatcher");
callback(); callback();

View File

@ -226,9 +226,8 @@ class Engine {
this.watch.start(); this.watch.start();
} }
webServerService(_options) { webServerService() {
_options.buildDir = this.config.buildDir; this.registerModule('webserver');
this.registerModule('webserver', _options);
} }
storageService(_options) { storageService(_options) {

View File

@ -10,18 +10,16 @@ const Templates = {
}; };
class WebServer { class WebServer {
constructor(embark, options) { constructor(embark) {
this.embark = embark; this.embark = embark;
this.logger = embark.logger; this.logger = embark.logger;
this.events = embark.events; this.events = embark.events;
this.buildDir = options.buildDir; this.buildDir = embark.config.buildDir;
this.webServerConfig = embark.config.webServerConfig; this.webServerConfig = embark.config.webServerConfig;
if (!this.webServerConfig.enabled) { if (!this.webServerConfig.enabled) {
return; return;
} }
this.host = options.host || this.webServerConfig.host;
this.port = options.port || this.webServerConfig.port;
this.events.emit("status", __("Starting Server")); this.events.emit("status", __("Starting Server"));