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) {