health.ts
This file
Path
packages/kit/src/health.ts
17 lines · 416 bytes · TypeScript
Last changed by
History of this fileTake it
123456789101112131415161718import { legacyFetch } from "./legacy.ts";import { API } from "./transport.ts";import type { Transport } from "./transport.ts";
/** Whether the named service answers its health check. */export const isHealthy = async ( service: string, transport?: Transport): Promise<boolean> => { try { await legacyFetch(`${API}/${service}/health`, transport);
return true; } catch { return false; }};