(path: string)
| 164 | } |
| 165 | |
| 166 | async function get<T>(path: string): Promise<T | null> { |
| 167 | try { |
| 168 | const res = await fetch(path); |
| 169 | return res.ok ? ((await res.json()) as T) : null; |
| 170 | } catch { |
| 171 | return null; |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | export const fetchHealth = () => get<Health>("/health"); |
| 176 | export const fetchConnections = () => get<ConnectionState>("/v1/connections"); |
no outgoing calls
no test coverage detected