From 3302041062a7ebaac5d45727fa456b84d474e5c3 Mon Sep 17 00:00:00 2001 From: lemuel Date: Tue, 31 May 2022 13:04:59 -0500 Subject: [PATCH] cors --- src/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index aa141f0..3fee84c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,9 +12,10 @@ async function bootstrap() { .setVersion('1.0') .build(); const document = SwaggerModule.createDocument(app, config); - SwaggerModule.setup('/api', app, document); + SwaggerModule.setup('/api', app, document); app.useGlobalPipes(new ValidationPipe({ whitelist: true })); + app.enableCors(); await app.listen(process.env.API_PORT); } bootstrap();