From 46d4c48abce8bee2a441787c94e1dadae86b8927 Mon Sep 17 00:00:00 2001 From: Pau Costa Date: Mon, 26 Aug 2024 21:25:01 +0200 Subject: [PATCH] :closed_lock_with_key: adds .env configuration of listening port --- src/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index ba90ede..456d079 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,10 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import 'dotenv/config'; +import * as process from 'node:process'; async function bootstrap() { const app = await NestFactory.create(AppModule); - await app.listen(3030); + await app.listen(process.env.PORT || 3000); } bootstrap();