Download src/app/api/knowledge-base/sslc-physics/visual-frames/route.ts from asnannp/DocDoeAI: direct link, hf CLI and curl.
- Browser
- Download file 667 Bytes
-
https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/app/api/knowledge-base/sslc-physics/visual-frames/route.ts
- Command line
-
hf download hf://spaces/asnannp/DocDoeAI/src/app/api/knowledge-base/sslc-physics/visual-frames/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/app/api/knowledge-base/sslc-physics/visual-frames/route.ts
667 Bytes
| import { NextResponse } from "next/server"; | |
| import { getVisualLessonFrames } from "@/lib/knowledge-base/sslc-physics"; | |
| export async function GET(request: Request) { | |
| const { searchParams } = new URL(request.url); | |
| const chapterId = searchParams.get("chapterId"); | |
| if (!chapterId) { | |
| return NextResponse.json({ error: "chapterId is required" }, { status: 400 }); | |
| } | |
| try { | |
| const data = getVisualLessonFrames(chapterId); | |
| if (!data) { | |
| return NextResponse.json({ error: "Not found" }, { status: 404 }); | |
| } | |
| return NextResponse.json(data); | |
| } catch { | |
| return NextResponse.json({ error: "Internal server error" }, { status: 500 }); | |
| } | |
| } | |