Don't start web server if env is not there

This commit is contained in:
Mint
2022-11-13 19:01:29 +09:00
parent b4d2a93a98
commit 9c9434f4ba
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -44,6 +44,10 @@ class App {
}
public loadExpress(): void {
if (!Environment.get().WEB_HOST || !Environment.get().WEB_PORT) {
Logger.log('warn', 'WEB_HOST or WEB_PORT is not defined in .env, not starting web server');
return;
}
Logger.log('info', 'Loading Express');
Express.init();
}
+1 -1
View File
@@ -30,7 +30,7 @@ class Express {
}
public end(): void {
if(this.server != null)
if(this.server)
this.server.close();
}