mirror of https://github.com/embarklabs/embark.git
openBrowser config option
This commit is contained in:
parent
c360975e8f
commit
1b7aed8b80
|
@ -314,6 +314,7 @@ Config.prototype.loadWebServerConfigFile = function() {
|
|||
var configObject = {
|
||||
"enabled": true,
|
||||
"host": defaultHost,
|
||||
"openBrowser": true,
|
||||
"port": 8000
|
||||
};
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ class WebServer {
|
|||
return;
|
||||
}
|
||||
|
||||
this._openBrowser = this.webServerConfig.openBrowser;
|
||||
|
||||
this.events.emit("status", __("Starting Server"));
|
||||
|
||||
|
@ -128,6 +129,9 @@ class WebServer {
|
|||
}
|
||||
|
||||
openBrowser(cb) {
|
||||
if (!this._openBrowser) {
|
||||
return cb();
|
||||
}
|
||||
const _cb = () => { cb(); };
|
||||
return opn(
|
||||
`http://${canonicalHost(this.server.hostname)}:${this.server.port}`,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
module.exports = {
|
||||
enabled: true,
|
||||
host: "localhost",
|
||||
openBrowser: true,
|
||||
port: 8000
|
||||
};
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
module.exports = {
|
||||
enabled: true,
|
||||
host: "localhost",
|
||||
openBrowser: true,
|
||||
port: 8000
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue