api9nin / src /app /api /usage /logs /route.js
github-actions[bot]
deploy from github actions 2026-06-18
c8ae75d
Raw
History Blame Contribute Delete
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 });
}
}