INNER CODE UNIT · TypeScript
isBackendHealthy
Beever-AI/beever-atlas · bot/src/index.ts:593
async function isBackendHealthy(): Promise<boolean> {
try {
const response = await fetch(`${BACKEND_URL}/api/health`, { signal: AbortSignal.timeout(3000) });
return response.ok;
} catch {
return false;
}
}
// ── Startup sync with retry ──────────────────────────────────────────────────
/**
* Fetches connections from the backend and registers them. Returns true if
* at least one connection was synced, false otherwise.
*/
async function syncConnectionsFromBackend(chatManager: ChatManager, label: string): Promise<boolean> {
const BRIDGE_API_KEY = process.env.BRIDGE_API_KEY || "";
const headers: Record<string, string> = {};