chore: bootstrap development environment
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import { checkDatabase } from '$lib/server/db/client';
|
||||
|
||||
export function GET() {
|
||||
const checkedAt = new Date().toISOString();
|
||||
|
||||
try {
|
||||
checkDatabase();
|
||||
|
||||
return json({
|
||||
ok: true,
|
||||
service: 'holodream-tools',
|
||||
database: 'ok',
|
||||
checkedAt
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Health check failed', error);
|
||||
|
||||
return json(
|
||||
{
|
||||
ok: false,
|
||||
service: 'holodream-tools',
|
||||
database: 'unavailable',
|
||||
checkedAt
|
||||
},
|
||||
{ status: 503 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user