Update API configuration to support additional environment variables for improved flexibility
- Modified baseURL and cdnURL in api.config.ts to include VITE_INDEEHUB_API_URL, enhancing the ability to switch between different API endpoints. - Updated initMockMode function in mock.ts to reflect the changes in API URL handling, ensuring consistency across the application.
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
*/
|
||||
|
||||
export const apiConfig = {
|
||||
baseURL: import.meta.env.VITE_API_URL || 'http://localhost:4000',
|
||||
baseURL: import.meta.env.VITE_API_URL || import.meta.env.VITE_INDEEHUB_API_URL || 'http://localhost:4000',
|
||||
timeout: Number(import.meta.env.VITE_API_TIMEOUT) || 30000,
|
||||
cdnURL: import.meta.env.VITE_CDN_URL || '',
|
||||
cdnURL: import.meta.env.VITE_CDN_URL || import.meta.env.VITE_INDEEHUB_CDN_URL || '',
|
||||
enableRetry: true,
|
||||
maxRetries: 3,
|
||||
retryDelay: 1000,
|
||||
|
||||
@@ -32,7 +32,7 @@ export async function initMockMode(): Promise<void> {
|
||||
// Nothing to check if mock is already on
|
||||
if (USE_MOCK) return
|
||||
|
||||
const apiUrl = import.meta.env.VITE_API_URL || 'http://localhost:4000'
|
||||
const apiUrl = import.meta.env.VITE_API_URL || import.meta.env.VITE_INDEEHUB_API_URL || 'http://localhost:4000'
|
||||
|
||||
try {
|
||||
const controller = new AbortController()
|
||||
|
||||
Reference in New Issue
Block a user