mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 19:50:38 +09:00
21 lines
543 B
TypeScript
21 lines
543 B
TypeScript
|
|
export type HealthStatus = {
|
||
|
|
status: "ok";
|
||
|
|
deploymentMode?: "local_trusted" | "authenticated";
|
||
|
|
deploymentExposure?: "private" | "public";
|
||
|
|
authReady?: boolean;
|
||
|
|
bootstrapStatus?: "ready" | "bootstrap_pending";
|
||
|
|
};
|
||
|
|
|
||
|
|
export const healthApi = {
|
||
|
|
get: async (): Promise<HealthStatus> => {
|
||
|
|
const res = await fetch("/api/health", {
|
||
|
|
credentials: "include",
|
||
|
|
headers: { Accept: "application/json" },
|
||
|
|
});
|
||
|
|
if (!res.ok) {
|
||
|
|
throw new Error(`Failed to load health (${res.status})`);
|
||
|
|
}
|
||
|
|
return res.json();
|
||
|
|
},
|
||
|
|
};
|