mirror of
https://github.com/tale/headplane.git
synced 2026-08-27 07:27:41 +00:00
13 lines
346 B
TypeScript
13 lines
346 B
TypeScript
import type { Route } from "./+types/healthz";
|
|
|
|
export async function loader({ context }: Route.LoaderArgs) {
|
|
const healthy = await context.headscale.health();
|
|
|
|
return new Response(JSON.stringify({ status: healthy ? "OK" : "ERROR" }), {
|
|
status: healthy ? 200 : 500,
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
});
|
|
}
|