Commit 1d7214b8 authored by Lorenzo Trujillo Rojas's avatar Lorenzo Trujillo Rojas
Browse files

Se movió la carga del .env al contexto global

parent 52d1536d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
import * as dotenv from 'dotenv';
dotenv.config();
export class DbConstants {
  static DB_HOST: string = process.env.DB_HOST || 'localhost';
  static DB_PORT: number = process.env.DB_PORT ? parseInt(process.env.DB_PORT) : 3306;
+2 −0
Original line number Diff line number Diff line
@@ -3,8 +3,10 @@ import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { ServerConstants } from './constants/server.contants';
import { ValidationPipe } from '@nestjs/common';
import * as dotenv from 'dotenv';

async function bootstrap() {
  dotenv.config();
  const app = await NestFactory.create(AppModule);
  app.useGlobalPipes(
    new ValidationPipe({