From 4c5995f16655a21903e8e8847235fc7817a1183b Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Sat, 13 Aug 2022 19:14:25 +0100 Subject: [PATCH] feat(server): change port via environment variable --- src/server/main.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/main.ts b/src/server/main.ts index 556039f..589d40b 100644 --- a/src/server/main.ts +++ b/src/server/main.ts @@ -107,5 +107,7 @@ io.on('connection', (socket) => { }); }); -console.log('listening on port :3000'); -io.listen(3000); +const port = parseInt(process.env.PORT || '3000'); + +console.log(`listening on port :${port}`); +io.listen(port);