Fix race condition

This commit is contained in:
Anthony Laibe 2018-10-01 10:10:17 +01:00
parent aa729607c9
commit 5481241760
2 changed files with 5 additions and 4 deletions

View File

@ -38,6 +38,9 @@ class WebServer {
openBrowser: this.webServerConfig.openBrowser
});
this.listenToCommands();
this.registerConsoleCommands();
this.events.on('webserver:config:change', () => {
this.embark.config.webServerConfig = null;
this.embark.config.loadWebServerConfigFile();
@ -59,8 +62,6 @@ class WebServer {
});
this.testPort(() => {
this.listenToCommands();
this.registerConsoleCommands();
this.server.start((_err, message, port) => {
this.logger.info(message);
this.port = port;

View File

@ -42,9 +42,9 @@ class Server {
this.app = express();
expressWebSocket(this.app);
this.app.use(main);
this.app.use(cors());
this.app.use(main);
this.app.use('/coverage', coverage);
this.app.use(coverageStyle);