Project started 🥂
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export const DEFAULT_API_BASE_URL = import.meta.env.PUBLIC_API_BASE_URL ?? '/api/v1';
|
||||
@@ -0,0 +1,15 @@
|
||||
import { DEFAULT_API_BASE_URL } from './env';
|
||||
|
||||
const STORAGE_KEY = 'mcma_api_base_url';
|
||||
|
||||
export function getApiBaseUrl(): string {
|
||||
return localStorage.getItem(STORAGE_KEY) ?? DEFAULT_API_BASE_URL;
|
||||
}
|
||||
|
||||
export function setApiBaseUrl(url: string): void {
|
||||
localStorage.setItem(STORAGE_KEY, url);
|
||||
}
|
||||
|
||||
export function clearApiBaseUrl(): void {
|
||||
localStorage.removeItem(STORAGE_KEY);
|
||||
}
|
||||
Reference in New Issue
Block a user