Skip to content

Commit

Permalink
fix: Enabled CORS in Nest
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesGresset committed Dec 19, 2024
1 parent 9d56d76 commit f12faaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ValidationPipe } from '@nestjs/common';
* @returns {Promise<void>} Returns a promise that resolves when the application starts.
*/
async function bootstrap() {
const app = await NestFactory.create(AppModule, { abortOnError: false });
const app = await NestFactory.create(AppModule, { abortOnError: false, cors: true });

Check failure on line 24 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint / Run linters

Replace `·abortOnError:·false,·cors:·true` with `⏎····abortOnError:·false,⏎····cors:·true,⏎·`
app.useGlobalPipes(
new ValidationPipe({
whitelist: true, // Remove undefined properties in the DTO
Expand Down

0 comments on commit f12faaa

Please sign in to comment.