diff --git a/src/main.ts b/src/main.ts index 815e2a11..881996cc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -119,10 +119,13 @@ function bootstrap() { const httpServer = configService.get('SERVER'); + // Use the PORT environment variable set by Heroku, or fall back to the configured port + const port = process.env.PORT || httpServer.PORT; + ServerUP.app = app; const server = ServerUP[httpServer.TYPE]; - server.listen(httpServer.PORT, () => logger.log(httpServer.TYPE.toUpperCase() + ' - ON: ' + httpServer.PORT)); + server.listen(port, () => logger.log(httpServer.TYPE.toUpperCase() + ' - ON: ' + port)); initWA();