We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 823ec82 + 04ed0f8 commit 4853448Copy full SHA for 4853448
backend/question-service/app.ts
@@ -10,7 +10,7 @@ import questionRoutes from "./src/routes/questionRoutes.ts";
10
11
dotenv.config();
12
13
-const origin = process.env.ORIGINS
+const allowedOrigins = process.env.ORIGINS
14
? process.env.ORIGINS.split(",")
15
: ["http://localhost:5173", "http://127.0.0.1:5173"];
16
@@ -21,8 +21,8 @@ const app = express();
21
22
connectDB();
23
24
-app.use(cors({ origin: origin, credentials: true }));
25
-app.options("*", cors());
+app.use(cors({ origin: allowedOrigins, credentials: true }));
+app.options("*", cors({ origin: allowedOrigins, credentials: true }));
26
27
// To handle CORS Errors
28
app.use((req: Request, res: Response, next: NextFunction) => {
0 commit comments