mirror of https://github.com/embarklabs/embark.git
webServer svc doesn't need to handle cli opts (handled in core/config)
This commit is contained in:
parent
2b5268dc84
commit
c360975e8f
|
@ -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();
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue