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