api9nin / src /app /api /usage /history /route.js
github-actions[bot]
deploy from github actions 2026-06-18
c8ae75d
Raw
History Blame Contribute Delete
380 Bytes
import { NextResponse } from "next/server";
import { getUsageStats } from "@/lib/usageDb";
export async function GET() {
try {
const stats = await getUsageStats();
return NextResponse.json(stats);
} catch (error) {
console.error("Error fetching usage stats:", error);
return NextResponse.json({ error: "Failed to fetch usage stats" }, { status: 500 });
}
}