Ajout d'en-tête CORS navigateur

This commit is contained in:
Emmy D'Anello 2024-12-09 22:49:31 +01:00
parent 62559810b0
commit 4be37ac303
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

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