Ajout d'en-tête CORS navigateur

This commit is contained in:
2024-12-09 22:49:31 +01:00
parent 62559810b0
commit 4be37ac303

View File

@ -4,7 +4,7 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
import { ClassSerializerInterceptor, ValidationPipe } from '@nestjs/common'
async function bootstrap() {
const app = await NestFactory.create(AppModule)
const app = await NestFactory.create(AppModule, { cors: true })
app.useGlobalPipes(new ValidationPipe({ transform: true }))
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)))