Spaces:
Runtime error
Runtime error
Enhance CORS configuration with explicit headers and methods
Browse files- gateway.ts +3 -1
gateway.ts
CHANGED
|
@@ -27,7 +27,9 @@ initDemoUser();
|
|
| 27 |
// Middleware
|
| 28 |
app.use(cors({
|
| 29 |
origin: process.env.FRONTEND_URL || '*',
|
| 30 |
-
credentials: true
|
|
|
|
|
|
|
| 31 |
}));
|
| 32 |
app.use(express.json());
|
| 33 |
|
|
|
|
| 27 |
// Middleware
|
| 28 |
app.use(cors({
|
| 29 |
origin: process.env.FRONTEND_URL || '*',
|
| 30 |
+
credentials: true,
|
| 31 |
+
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
|
| 32 |
+
allowedHeaders: ['Content-Type', 'Authorization']
|
| 33 |
}));
|
| 34 |
app.use(express.json());
|
| 35 |
|