feat: complete v0.5 operations foundation
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { db } from "@/lib/db";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export async function GET() {
|
||||
try {
|
||||
db.prepare("SELECT 1").get();
|
||||
const failedJobs = Number((db.prepare("SELECT count(*) AS count FROM sync_jobs WHERE status='failed'").get() as { count: number }).count);
|
||||
return NextResponse.json({ ok: true, version: process.env.APP_VERSION || "development", database: "ok", failedJobs, timestamp: new Date().toISOString() });
|
||||
} catch { return NextResponse.json({ ok: false, database: "error" }, { status: 503 }); }
|
||||
}
|
||||
Reference in New Issue
Block a user