MCPcopy Create free account
hub / github.com/PaperDebugger/paperdebugger / getEndpointFromStorage

Function getEndpointFromStorage

webapp/_webapp/src/libs/apiclient.ts:278–288  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

276
277// Create apiclient instance with endpoint from storage or default
278export const getEndpointFromStorage = () => {
279 let endpoint;
280 try {
281 endpoint = storage.getItem(LOCAL_STORAGE_KEY_V1) || DEFAULT_ENDPOINT;
282 } catch {
283 // Fallback if storage is not available
284 endpoint = DEFAULT_ENDPOINT;
285 }
286
287 return sanitizeEndpoint(endpoint.replace("/_pd/api/v1", "").replace("/_pd/api/v2", "")); // compatible with old endpoint
288};
289
290/**
291 * @deprecated Use getEndpointFromStorage instead

Callers 3

resetApiClientEndpointFunction · 0.85
initApiClientFromStorageFunction · 0.85
apiclient.tsFile · 0.85

Calls 2

sanitizeEndpointFunction · 0.85
getItemMethod · 0.65

Tested by

no test coverage detected