import { ConvictSchema } from "./types"; export interface ICorsConfig { allowedMethods: Array; allowedOrigins: Array; allowedHeaders: Array; } export const CorsConfig: ConvictSchema = { allowedMethods: { doc: "The allowed CORS methods", format: "Array", env: "CORS_ALLOWED_METHODS", default: ["GET", "PUT", "POST", "PATCH", "DELETE", "HEAD", "OPTIONS"], }, allowedOrigins: { doc: "The allowed origins", format: "Array", env: "CORS_ALLOWED_ORIGINS", default: [], }, allowedHeaders: { doc: "The allowed headers", format: "Array", env: "CORS_ALLOWED_HEADERS", default: [ "content-type", "authorization", "cf-access-authenticated-user-email", ], }, };