MCPcopy Create free account
hub / github.com/tiann/hapi / checkServerHealth

Function checkServerHealth

cli/src/utils/autoStartServer.ts:57–66  ·  view source on GitHub ↗

* Check if hub is ready via health endpoint

(url: string)

Source from the content-addressed store, hash-verified

55 * Check if hub is ready via health endpoint
56 */
57async function checkServerHealth(url: string): Promise<boolean> {
58 try {
59 const response = await fetch(`${url}/health`, {
60 signal: AbortSignal.timeout(1000)
61 })
62 return response.ok
63 } catch {
64 return false
65 }
66}
67
68/**
69 * Wait for hub to become ready

Callers 1

waitForServerReadyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected