MCPcopy
hub / github.com/simstudioai/sim / getInternalApiBaseUrl

Function getInternalApiBaseUrl

apps/sim/lib/core/utils/urls.ts:42–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40 * Falls back to NEXT_PUBLIC_APP_URL when INTERNAL_API_BASE_URL is not set.
41 */
42export function getInternalApiBaseUrl(): string {
43 const internalBaseUrl = getEnv('INTERNAL_API_BASE_URL')?.trim()
44 if (!internalBaseUrl) {
45 return getBaseUrl()
46 }
47
48 if (!hasHttpProtocol(internalBaseUrl)) {
49 throw new Error(
50 'INTERNAL_API_BASE_URL must include protocol (http:// or https://), e.g. http://sim-app.default.svc.cluster.local:3000'
51 )
52 }
53
54 return internalBaseUrl
55}
56
57/**
58 * Ensures a URL is absolute by prefixing the base URL when a relative path is provided.

Callers 15

executeToolFunction · 0.90
isSelfOriginUrlFunction · 0.90
executeToolRequestFunction · 0.90
executeMcpToolFunction · 0.90
image.tsFile · 0.90
connectorApiCallFunction · 0.90
addDocumentFunction · 0.90
updateDocumentFunction · 0.90
maskPIIBatchViaHttpFunction · 0.90
queryKnowledgeBaseFunction · 0.90
prefetchInternalJsonFunction · 0.90
prefetchSubscriptionDataFunction · 0.90

Calls 3

getEnvFunction · 0.90
hasHttpProtocolFunction · 0.85
getBaseUrlFunction · 0.70

Tested by

no test coverage detected