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

Function getApiBaseUrl

client-next/src/lib/api.ts:81–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79export const MIN_SERVER_VERSION = '2.2.2';
80
81export async function getApiBaseUrl(): Promise<string> {
82 try {
83 const url = await discoverBackendPort();
84 api.defaults.baseURL = url;
85 return url;
86 } catch {
87 return api.defaults.baseURL || envApiUrl || 'http://127.0.0.1:1920/api';
88 }
89}
90
91function compareVersions(current: string, minimum: string): boolean {
92 const c = current.split('.').map(Number);

Callers 2

connectFunction · 0.90
loadDetailsFunction · 0.90

Calls 1

discoverBackendPortFunction · 0.85

Tested by

no test coverage detected