added NODE_ENV variable checking to server.ts
Frontend CI/CD / test-and-build (push) Successful in 24s
Frontend CI/CD / deploy (push) Successful in 25s

This commit is contained in:
itzMiney committed 2026-11-08 01:07:12 +01:00
1 parent 2d9225d625
commit e20d4b45b6
1 file changed
+1 -1
+1 -1
View File
@@ -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. * 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. * 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; const port = process.env['PORT'] || 4000;
app.listen(port, (error) => { app.listen(port, (error) => {
if (error) { if (error) {