Fix CORS to allow both port 5173 and 5174

This commit is contained in:
2025-11-16 20:42:32 +00:00
parent 9d1f2e735e
commit a953e63dd8

View File

@@ -18,7 +18,11 @@ app.use(helmet({
contentSecurityPolicy: false, // Disable CSP for development contentSecurityPolicy: false, // Disable CSP for development
})); }));
app.use(cors({ app.use(cors({
origin: process.env.CORS_ORIGIN || 'http://localhost:5173', origin: [
'http://localhost:5173',
'http://localhost:5174',
process.env.CORS_ORIGIN || ''
].filter(Boolean),
credentials: true, credentials: true,
})); }));
app.use(express.json()); app.use(express.json());