Download src/app/api/v1/web/fetch/route.js from heyeyydss/api9nin: direct link, hf CLI and curl.
- Browser
- Download file 462 Bytes
-
https://huggingface.co/spaces/heyeyydss/api9nin/resolve/main/src/app/api/v1/web/fetch/route.js
- Command line
-
hf download hf://spaces/heyeyydss/api9nin/src/app/api/v1/web/fetch/route.js
-
curl -L -o route.js https://huggingface.co/spaces/heyeyydss/api9nin/resolve/main/src/app/api/v1/web/fetch/route.js
462 Bytes
| import { handleFetch } from "@/sse/handlers/fetch.js"; | |
| /** | |
| * Handle CORS preflight | |
| */ | |
| export async function OPTIONS() { | |
| return new Response(null, { | |
| headers: { | |
| "Access-Control-Allow-Origin": "*", | |
| "Access-Control-Allow-Methods": "POST, OPTIONS", | |
| "Access-Control-Allow-Headers": "*" | |
| } | |
| }); | |
| } | |
| /** | |
| * POST /v1/web/fetch - Web URL fetch/extract endpoint | |
| */ | |
| export async function POST(request) { | |
| return await handleFetch(request); | |
| } | |