MCPcopy Create free account
hub / github.com/Microck/opencode-studio / probeBackendUrl

Function probeBackendUrl

client-next/src/lib/api.ts:10–17  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

8let resolvingApiUrl: Promise<string> | null = null;
9
10async function probeBackendUrl(url: string): Promise<string | null> {
11 try {
12 await axios.get(`${url}/health`, { timeout: 500 });
13 return url;
14 } catch {
15 return null;
16 }
17}
18
19async function discoverBackendPort(): Promise<string> {
20 if (cachedApiUrl) return cachedApiUrl;

Callers 1

discoverBackendPortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected