| 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); | |
| } | |