mirror of
https://github.com/tale/headplane.git
synced 2026-08-13 07:06:51 +00:00
15 lines
423 B
TypeScript
15 lines
423 B
TypeScript
import type { Route } from './+types/healthz';
|
|
|
|
export async function loader({ context }: Route.LoaderArgs) {
|
|
// Use a fake API key for healthcheck
|
|
const api = context.hsApi.getRuntimeClient('fake-api-key');
|
|
const healthy = await api.isHealthy();
|
|
|
|
return new Response(JSON.stringify({ status: healthy ? 'OK' : 'ERROR' }), {
|
|
status: healthy ? 200 : 500,
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
});
|
|
}
|