1
0
forked from noxious/server

another fix, maybe

This commit is contained in:
Dennis Postma 2024-06-05 00:50:15 +02:00
parent 5206738cb9
commit d508ece9c7
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,8 @@ dotenv.config();
class config class config
{ {
static ENV: string = process.env.ENV || "prod"; static ENV: string = process.env.ENV || "prod";
static PORT: number = process.env.PORT ? parseInt(process.env.PORT) : 5000; static HOST: string = process.env.HOST || "0.0.0.0";
static PORT: number = process.env.PORT ? parseInt(process.env.PORT) : 6969;
static JWT_SECRET: string = process.env.JWT_SECRET || "secret"; static JWT_SECRET: string = process.env.JWT_SECRET || "secret";
} }

View File

@ -46,7 +46,7 @@ export class Server
// Start the server // Start the server
try { try {
await this.http.listen(config.PORT, '0.0.0.0'); await this.http.listen(config.PORT, config.HOST);
console.log('[✅] Socket.IO running on port', config.PORT); console.log('[✅] Socket.IO running on port', config.PORT);
} catch (error: any) { } catch (error: any) {
throw new Error(`[❌] Socket.IO failed to start: ${error.message}`); throw new Error(`[❌] Socket.IO failed to start: ${error.message}`);