Skip to content

Commit

Permalink
Update main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Amruth-Vamshi authored Jan 9, 2024
1 parent 4dd6a02 commit 3421420
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ async function bootstrap() {
process.exit(0);
});

app.enableCors();
app.enableCors({
origin: configService.get<string>('CORS_ALLOWED_ORIGINS', '').split(','),
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'],
credentials: true,
});
await app.register(multipart);
await app.register(compression, { encodings: ["gzip", "deflate"] });
app.useStaticAssets({ root: join(__dirname, "../../fileUploads") });
Expand Down

0 comments on commit 3421420

Please sign in to comment.