Files
Iris_back/src/main.ts
T

24 lines
691 B
TypeScript
Raw Normal View History

2025-05-12 11:05:17 -06:00
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
2025-11-27 17:32:14 -06:00
import { ValidationPipe } from '@nestjs/common';
2025-05-12 11:05:17 -06:00
async function bootstrap() {
const app = await NestFactory.create(AppModule);
2025-05-20 15:53:57 -06:00
2025-11-27 17:32:14 -06:00
app.useGlobalPipes(
new ValidationPipe({
whitelist: true, // elimina propiedades que no existan en el DTO
transform: true, // permite que @Type() funcione
transformOptions: { enableImplicitConversion: true }, // convierte strings → number/date
}),
);
2025-05-20 15:53:57 -06:00
app.enableCors();
2025-10-31 12:18:28 -06:00
await app.listen(process.env.APP_PORT ?? 3000);
console.log(
`Aplicación corriendo en: http://localhost:${process.env.APP_PORT ?? 3000}`,
);
2025-05-12 11:05:17 -06:00
}
bootstrap();