Backup: 2025-06-07 18:32 - Production setup complete
[Restore from backup: vip-coordinator-backup-2025-06-07-18-32-production-setup-complete]
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
const DEFAULT_API_BASE =
|
||||
typeof window !== 'undefined'
|
||||
? window.location.origin
|
||||
: 'http://localhost:3000';
|
||||
|
||||
export const API_BASE_URL =
|
||||
import.meta.env.VITE_API_URL?.replace(/\/$/, '') || DEFAULT_API_BASE;
|
||||
// API Configuration
|
||||
// Use environment variable with fallback to production URL
|
||||
export const API_BASE_URL = import.meta.env.VITE_API_URL || 'https://api.bsa.madeamess.online';
|
||||
|
||||
// Helper function for API calls
|
||||
export const apiCall = (endpoint: string, options?: RequestInit) => {
|
||||
const url = /^https?:\/\//.test(endpoint)
|
||||
? endpoint
|
||||
: `${API_BASE_URL}${endpoint}`;
|
||||
const url = endpoint.startsWith('/') ? `${API_BASE_URL}${endpoint}` : endpoint;
|
||||
return fetch(url, options);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user