From e20d4b45b6a75b3f4a52463181b5ea88e512e84c Mon Sep 17 00:00:00 2001 From: itzMiney Date: Sun, 8 Nov 2026 01:07:12 +0100 Subject: [PATCH] added NODE_ENV variable checking to server.ts --- src/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.ts b/src/server.ts index db7d742..0d62306 100644 --- a/src/server.ts +++ b/src/server.ts @@ -78,7 +78,7 @@ app.use((req, res, next) => { * Start the server if this module is the main entry point, or it is ran via PM2. * The server listens on the port defined by the `PORT` environment variable, or defaults to 4000. */ -if (isMainModule(import.meta.url) || process.env['pm_id']) { +if (isMainModule(import.meta.url) || process.env['pm_id'] || process.env['NODE_ENV'] === 'production') { const port = process.env['PORT'] || 4000; app.listen(port, (error) => { if (error) {