feat: add request logging functionality and usage metrics display

This commit is contained in:
decolua
2026-01-09 17:40:59 +07:00
parent e4f92cd104
commit e4769070b3
7 changed files with 233 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
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 });
}
}