Download app/api/progress/route.ts from d3evil4/scrape: direct link, hf CLI and curl.
- Browser
- Download file 503 Bytes
-
https://huggingface.co/spaces/d3evil4/scrape/resolve/main/app/api/progress/route.ts
- Command line
-
hf download hf://spaces/d3evil4/scrape/app/api/progress/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/d3evil4/scrape/resolve/main/app/api/progress/route.ts
503 Bytes
| import { NextRequest, NextResponse } from "next/server"; | |
| import { getProgress } from "@/lib/progress"; | |
| export const runtime = "nodejs"; | |
| export async function GET(req: NextRequest) { | |
| const id = req.nextUrl.searchParams.get("id"); | |
| if (!id) return NextResponse.json({ error: "Missing id" }, { status: 400 }); | |
| const progress = getProgress(id); | |
| if (!progress) { | |
| return NextResponse.json({ percent: 0, stage: "extracting", message: "Waiting..." }); | |
| } | |
| return NextResponse.json(progress); | |
| } | |