MCPcopy Create free account
hub / github.com/agent-tower/core / shouldUseDevSameOriginProxy

Function shouldUseDevSameOriginProxy

packages/web/src/lib/api-base-url.ts:16–26  ·  view source on GitHub ↗
(value: string | undefined)

Source from the content-addressed store, hash-verified

14}
15
16function shouldUseDevSameOriginProxy(value: string | undefined): boolean {
17 if (!import.meta.env.DEV || !value) return false
18
19 try {
20 const url = new URL(value)
21 return (url.protocol === 'http:' || url.protocol === 'https:')
22 && isLoopbackHostname(url.hostname)
23 } catch {
24 return false
25 }
26}
27
28export function getApiBaseUrl(): string {
29 const configured = import.meta.env.VITE_API_URL

Callers 2

getApiBaseUrlFunction · 0.85
getSocketBaseUrlFunction · 0.85

Calls 1

isLoopbackHostnameFunction · 0.85

Tested by

no test coverage detected