Merge pull request 'Fix CORS config for staging environment' (#71) from nico/25-feb-26 into staggingweb

Reviewed-on: #71
This commit is contained in:
2026-02-25 23:15:18 +08:00

View File

@@ -46,11 +46,17 @@ fs.mkdir(UPLOAD_DIR_IMAGE, {
}).catch(() => {});
const corsConfig = {
origin: "*",
methods: ["GET", "POST", "PATCH", "DELETE", "PUT"] as HTTPMethod[],
allowedHeaders: "*",
origin: [
"http://localhost:3000",
"http://localhost:3001",
"https://cld-dkr-desa-darmasaba-stg.wibudev.com",
"https://cld-dkr-staging-desa-darmasaba.wibudev.com",
"*", // Allow all origins in development
],
methods: ["GET", "POST", "PATCH", "DELETE", "PUT", "OPTIONS"] as HTTPMethod[],
allowedHeaders: ["Content-Type", "Authorization", "*"],
exposedHeaders: "*",
maxAge: 5,
maxAge: 86400, // 24 hours
credentials: true,
};