🔐 adds .env configuration of listening port

main
Pau Costa Ferrer 2024-08-26 21:25:01 +02:00
parent af51b63d66
commit 46d4c48abc
1 changed files with 2 additions and 1 deletions

View File

@ -1,9 +1,10 @@
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module'; import { AppModule } from './app.module';
import 'dotenv/config'; import 'dotenv/config';
import * as process from 'node:process';
async function bootstrap() { async function bootstrap() {
const app = await NestFactory.create(AppModule); const app = await NestFactory.create(AppModule);
await app.listen(3030); await app.listen(process.env.PORT || 3000);
} }
bootstrap(); bootstrap();