Download src/app/api/usage/logs/route.js from heyeyydss/api9nin: direct link, hf CLI and curl.
- Browser
- Download file 367 Bytes
-
https://huggingface.co/spaces/heyeyydss/api9nin/resolve/main/src/app/api/usage/logs/route.js
- Command line
-
hf download hf://spaces/heyeyydss/api9nin/src/app/api/usage/logs/route.js
-
curl -L -o route.js https://huggingface.co/spaces/heyeyydss/api9nin/resolve/main/src/app/api/usage/logs/route.js
367 Bytes
| import { NextResponse } from "next/server"; | |
| import { getRecentLogs } from "@/lib/usageDb"; | |
| export async function GET() { | |
| try { | |
| const logs = await getRecentLogs(200); | |
| return NextResponse.json(logs); | |
| } catch (error) { | |
| console.error("Error fetching logs:", error); | |
| return NextResponse.json({ error: "Failed to fetch logs" }, { status: 500 }); | |
| } | |
| } | |