MCPcopy
hub / github.com/OpenBMB/UltraRAG / buildApiUrl

Function buildApiUrl

ui/frontend/src/shared/api/http.ts:16–21  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

14};
15
16export function buildApiUrl(path: string): string {
17 if (/^https?:\/\//.test(path)) return path;
18 const apiBase = (import.meta.env.VITE_API_BASE ?? "").trim();
19 if (!apiBase) return path;
20 return `${apiBase.replace(/\/$/, "")}${path}`;
21}
22
23async function parseResponse<T>(response: Response): Promise<T> {
24 const contentType = response.headers.get("content-type") ?? "";

Callers 3

streamPipelineChatFunction · 0.90
exportChatDocxFunction · 0.90
httpRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected