feat: ship self-hosted KOC LOOP workflows
This commit is contained in:
24
app/api/health/route.ts
Normal file
24
app/api/health/route.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { checkDatabaseConnection } from "../../../lib/database";
|
||||
import { getObjectStore } from "../../../lib/object-store";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const database = await checkDatabaseConnection();
|
||||
return Response.json({
|
||||
status: database ? "ok" : "degraded",
|
||||
database,
|
||||
storage: getObjectStore().root,
|
||||
scheduler: process.env.ENABLE_SCHEDULER !== "false",
|
||||
timestamp: new Date().toISOString(),
|
||||
}, { status: database ? 200 : 503 });
|
||||
} catch (error) {
|
||||
return Response.json(
|
||||
{
|
||||
status: "error",
|
||||
database: false,
|
||||
error: error instanceof Error ? error.message : "health check failed",
|
||||
},
|
||||
{ status: 503 },
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user