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);
});
if (options.runWebserver) {
engine.startService("webServer", {
host: options.serverHost,
port: options.serverPort
});
if (webServerConfig.enabled !== false) {
engine.startService("webServer");
}
engine.startService("fileWatcher");
callback();

View File

@ -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) {

View File

@ -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"));