MCPcopy Create free account
hub / github.com/ShipSecAI/studio / resolveApiBaseUrl

Function resolveApiBaseUrl

frontend/src/services/api.ts:73–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71};
72
73function resolveApiBaseUrl() {
74 const metaEnv = (import.meta as RuntimeImportMeta).env;
75 if (metaEnv?.VITE_API_URL && metaEnv.VITE_API_URL.trim().length > 0) {
76 return metaEnv.VITE_API_URL;
77 }
78
79 if (typeof process !== 'undefined') {
80 const nodeEnv = (process.env ?? {}).VITE_API_URL;
81 if (nodeEnv && nodeEnv.trim().length > 0) {
82 return nodeEnv;
83 }
84 }
85
86 return 'http://localhost:3211';
87}
88
89export const API_BASE_URL = resolveApiBaseUrl();
90export const API_V1_URL = `${API_BASE_URL}/api/v1`;

Callers 1

api.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected