Download src/config/cors.config.ts from lynfera/api: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/lynfera/api/resolve/main/src/config/cors.config.ts
- Command line
-
hf download hf://spaces/lynfera/api/src/config/cors.config.ts
-
curl -L -o cors.config.ts https://huggingface.co/spaces/lynfera/api/resolve/main/src/config/cors.config.ts
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 | |
| }; | |