feat: add preprod URL to CORS allowed origins

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
soufiane 2025-12-06 17:44:36 +01:00
parent c7019550c1
commit 6eda77e84c

View File

@ -25,14 +25,19 @@ app.use(
cors({ cors({
origin: function (origin, callback) { origin: function (origin, callback) {
const allowedOrigins = [ const allowedOrigins = [
// Localhost
"http://localhost:3000", "http://localhost:3000",
"http://localhost:3001", "http://localhost:3001",
"http://localhost:3002", "http://localhost:3002",
"http://localhost:3003", "http://localhost:3003",
"http://localhost:3004", "http://localhost:3004",
"http://localhost:3005", "http://localhost:3005",
// Production
"https://dsp5-archi-o24a-15m-g3.fr", "https://dsp5-archi-o24a-15m-g3.fr",
"https://dev.dsp5-archi-o24a-15m-g3.fr" // Dev
"https://dev.dsp5-archi-o24a-15m-g3.fr",
// Preprod
"https://preprod.dsp5-archi-o24a-15m-g3.fr"
]; ];
// Autoriser les requêtes sans origin (Postman, curl, etc.) // Autoriser les requêtes sans origin (Postman, curl, etc.)
if (!origin) return callback(null, true); if (!origin) return callback(null, true);