Load env var for api url into ui for production
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const baseUrl = import.meta.env.VITE_API_URL || 'http://localhost:8080/api';
|
||||
// @ts-expect-error The window.__CONFIG__ only exists in production
|
||||
const baseUrl = window.__CONFIG__?.API_URL || import.meta.env.VITE_API_URL || 'http://localhost:8080/api';
|
||||
|
||||
export async function getRequest(endpoint: string, params: Record<string, any> = {}): Promise<Response> {
|
||||
Object.keys(params).forEach((key) => params[key] === undefined && delete params[key]);
|
||||
|
||||
Reference in New Issue
Block a user