From 3e90deda5d6ab6fb08a2e64ef19bb1072c5ad743 Mon Sep 17 00:00:00 2001 From: Phill Pover Date: Fri, 28 Mar 2025 10:05:40 +0000 Subject: [PATCH] Fixing CORS --- backend/src/app.service.ts | 4 ++++ backend/src/main.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/app.service.ts b/backend/src/app.service.ts index 927d7cc..3f1fc9e 100644 --- a/backend/src/app.service.ts +++ b/backend/src/app.service.ts @@ -1,7 +1,11 @@ import { Injectable } from '@nestjs/common'; +import { ConfigService } from '@nestjs/config'; @Injectable() export class AppService { + constructor( + private readonly configService: ConfigService + ) {} getHello(): string { return 'Hello World!'; } diff --git a/backend/src/main.ts b/backend/src/main.ts index db8e898..b875596 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -6,7 +6,7 @@ const corsOptions = { async function bootstrap() { const app = await NestFactory.create(AppModule); - app.enableCors(); + app.enableCors(corsOptions); await app.listen(process.env.PORT ?? 3000); }