MCPcopy Create free account
hub / github.com/Tong89/smartNode / setBaseUrl

Method setBaseUrl

frontend/src/api/client.ts:80–88  ·  view source on GitHub ↗

Update the base URL and persist it to localStorage if non-empty.

(value: string)

Source from the content-addressed store, hash-verified

78
79 /** Update the base URL and persist it to localStorage if non-empty. */
80 setBaseUrl(value: string): void {
81 const normalized = (value || '').trim().replace(/\/$/, '');
82 this._baseUrl = normalized === window.location.origin ? '' : normalized;
83 if (this._baseUrl) {
84 localStorage.setItem('space_api_base', this._baseUrl);
85 } else {
86 localStorage.removeItem('space_api_base');
87 }
88 }
89
90 /** Build a fully-qualified URL for the given API path. */
91 url(path: string): string {

Callers 1

setApiBaseFunction · 0.80

Calls 1

trimMethod · 0.80

Tested by

no test coverage detected