From c1e462c603314af92f53579d77b91802a92a77ca Mon Sep 17 00:00:00 2001 From: Aditya Banerjee Date: Sun, 4 Feb 2024 22:39:00 +0800 Subject: [PATCH] fix port assignment --- telegram-bot/src/components/server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram-bot/src/components/server.ts b/telegram-bot/src/components/server.ts index d3ecc36..f6231d9 100644 --- a/telegram-bot/src/components/server.ts +++ b/telegram-bot/src/components/server.ts @@ -9,14 +9,14 @@ const { PORT: port, TELEGRAM_BOT_TOKEN: token = '' } = process.env; export class Server { static instance: Server; private app: Express; - private readonly port: number; + private readonly port: string | number; private logger: Log4js; private constructor() { this.logger = Logger.getLogger('Server'); this.logger.info('Initialising server'); this.app = express(); - this.port = Number(port); + this.port = port ?? 3000; this.app.use(json()); this.app.listen(this.port, () => { this.logger.info(`Server running on port ${this.port}`);