Fix race condition
This commit is contained in:
parent
0e87d21b12
commit
feb59655cc
|
@ -39,6 +39,9 @@ class WebServer {
|
||||||
openBrowser: this.webServerConfig.openBrowser
|
openBrowser: this.webServerConfig.openBrowser
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.listenToCommands();
|
||||||
|
this.registerConsoleCommands();
|
||||||
|
|
||||||
this.events.on('webserver:config:change', () => {
|
this.events.on('webserver:config:change', () => {
|
||||||
this.embark.config.webServerConfig = null;
|
this.embark.config.webServerConfig = null;
|
||||||
this.embark.config.loadWebServerConfigFile();
|
this.embark.config.loadWebServerConfigFile();
|
||||||
|
@ -60,8 +63,6 @@ class WebServer {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.testPort(() => {
|
this.testPort(() => {
|
||||||
this.listenToCommands();
|
|
||||||
this.registerConsoleCommands();
|
|
||||||
this.server.start((_err, message, port) => {
|
this.server.start((_err, message, port) => {
|
||||||
this.logger.info(message);
|
this.logger.info(message);
|
||||||
this.port = port;
|
this.port = port;
|
||||||
|
|
|
@ -54,8 +54,6 @@ class Server {
|
||||||
const main = serveStatic(this.buildDir, {'index': ['index.html', 'index.htm']});
|
const main = serveStatic(this.buildDir, {'index': ['index.html', 'index.htm']});
|
||||||
|
|
||||||
this.app = express();
|
this.app = express();
|
||||||
const expressWs = expressWebSocket(this.app);
|
|
||||||
|
|
||||||
// Assign Logging Function
|
// Assign Logging Function
|
||||||
this.app.use(function(req, res, next) {
|
this.app.use(function(req, res, next) {
|
||||||
if (self.logging) {
|
if (self.logging) {
|
||||||
|
@ -65,8 +63,8 @@ class Server {
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
this.app.use(main);
|
|
||||||
this.app.use(cors());
|
this.app.use(cors());
|
||||||
|
this.app.use(main);
|
||||||
this.app.use('/coverage', coverage);
|
this.app.use('/coverage', coverage);
|
||||||
this.app.use(coverageStyle);
|
this.app.use(coverageStyle);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue