MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / serverEndpointLabel

Function serverEndpointLabel

apps/kimi-web/src/api/config.ts:65–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63 * - prod (server serves the SPA) → the page origin (it IS the server).
64 */
65export 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.
79export function buildRestUrl(origin: string, path: string): string {

Callers

nothing calls this directly

Calls 2

shortOriginFunction · 0.85
normalizeServerOriginFunction · 0.70

Tested by

no test coverage detected