🔧 Simplify base URL logic to always use nginx proxy for CORS handling
This commit is contained in:
@@ -12,17 +12,11 @@ import { API_CONFIG } from '../utilities/constants.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the appropriate base URL based on environment
|
* Get the appropriate base URL based on environment
|
||||||
* Development: Use Vite proxy to avoid CORS
|
* Always use nginx proxy to avoid CORS issues
|
||||||
* Production: Use direct API (requires backend proxy or CORS handling)
|
|
||||||
*/
|
*/
|
||||||
function getBaseURL() {
|
function getBaseURL() {
|
||||||
// In development, use Vite proxy
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
return '/api/challonge/v1/';
|
return '/api/challonge/v1/';
|
||||||
}
|
}
|
||||||
// In production, use direct API (will need backend proxy for CORS)
|
|
||||||
return API_CONFIG.CHALLONGE_BASE_URL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Challonge API v1 client
|
* Create Challonge API v1 client
|
||||||
|
|||||||
Reference in New Issue
Block a user