settings work

This commit is contained in:
michalcourson
2026-02-22 14:57:04 -05:00
parent f2718282c7
commit d49ac95fa2
16 changed files with 205 additions and 103 deletions

View File

@ -0,0 +1,13 @@
const getBaseUrl = () => {
// You can store the base URL in localStorage, a config file, or state
return localStorage.getItem('baseUrl') || 'http://localhost:5010';
};
export function apiFetch(endpoint: string, options = {}) {
const url = `${getBaseUrl()}/${endpoint}`;
return fetch(url, options);
}
export function setBaseUrl(baseUrl: string) {
localStorage.setItem('baseUrl', baseUrl);
}