Spaces:
Sleeping

api / src /config /cors.config.ts
Amal Jose
added files
4e83772
Raw History Blame Contribute Delete
417 Bytes
import { CorsOptions } from "cors";
import { ENVS } from "@/config/env.config.js";
/**
* CORS options used globally in the application.
*/
export const corsOptions: CorsOptions = {
origin: ENVS.FRONTEND_URL,
methods: ["GET", "POST", "PUT", "PATCH", "DELETE"],
allowedHeaders: ["Content-Type", "Authorization", "X-redirect-path"],
credentials: true,
optionsSuccessStatus: 200, // Needed for legacy browsers
};