MCPcopy Index your code
hub / github.com/coder/mux / readInitialAppProxyBasePath

Function readInitialAppProxyBasePath

src/browser/utils/frontendBasePath.ts:6–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4// window itself exists. Guard both so module initialization cannot throw and leave
5// downstream importers with a TDZ-poisoned export.
6function readInitialAppProxyBasePath(): string | null {
7 if (typeof window === "undefined") {
8 return null;
9 }
10
11 const location = (window as { location?: { pathname?: string } }).location;
12 if (!location || typeof location.pathname !== "string") {
13 return null;
14 }
15
16 return getAppProxyBasePathFromPathname(location.pathname);
17}
18
19export const INITIAL_APP_PROXY_BASE_PATH = readInitialAppProxyBasePath();
20

Callers 1

Calls 1

Tested by

no test coverage detected