()
| 63 | * - prod (server serves the SPA) → the page origin (it IS the server). |
| 64 | */ |
| 65 | export function serverEndpointLabel(): string { |
| 66 | const direct = import.meta.env.VITE_KIMI_SERVER_HTTP_URL; |
| 67 | if (direct && direct.trim()) return shortOrigin(normalizeServerOrigin(direct)); |
| 68 | |
| 69 | const proxy = |
| 70 | typeof __KIMI_DEV_PROXY_TARGET__ !== 'undefined' ? __KIMI_DEV_PROXY_TARGET__ : ''; |
| 71 | if (import.meta.env.DEV && proxy) return shortOrigin(proxy); |
| 72 | |
| 73 | const origin = |
| 74 | typeof window !== 'undefined' && window.location?.origin ? window.location.origin : ''; |
| 75 | return shortOrigin(origin); |
| 76 | } |
| 77 | |
| 78 | // The real server serves everything (incl. healthz + ws) under the /api/v1 prefix. |
| 79 | export function buildRestUrl(origin: string, path: string): string { |
nothing calls this directly
no test coverage detected