app.use(
"/api/*",
cors({
origin: [
"http://localhost:5173",
"http://localhost:4173",
"https://my-app.vercel.app",
"https://my-app-dev.vercel.app",
],
allowHeaders: ["Content-Type", "Authorization", "Cookie"],
allowMethods: ["POST", "GET", "OPTIONS"],
exposeHeaders: ["Content-Length", "Set-Cookie"],
maxAge: 600,
credentials: true,
})
)
app.use(
"/api/*",
cors({
origin: [
"http://localhost:5173",
"http://localhost:4173",
"https://my-app.vercel.app",
"https://my-app-dev.vercel.app",
],
allowHeaders: ["Content-Type", "Authorization", "Cookie"],
allowMethods: ["POST", "GET", "OPTIONS"],
exposeHeaders: ["Content-Length", "Set-Cookie"],
maxAge: 600,
credentials: true,
})
)