File size: 602 Bytes
b4d058e
 
 
 
 
 
f3d46ba
 
2541c3c
b4d058e
 
f3d46ba
 
b4d058e
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Detect if we're running in a HF Space
const isHfSpace =
  window.location.hostname.endsWith(".hf.space") ||
  window.location !== window.parent.location;

// Get the base API URL based on the environment
const API_BASE_URL = isHfSpace
  ? `${window.location.origin}` // En production (HF Space), on utilise l'URL racine
  : "http://localhost:3002"; // En développement

export const API_URLS = {
  leaderboards: `${API_BASE_URL}/api/leaderboards`,
  health: `${API_BASE_URL}/api/health`,
};

// Export additional environment info
export const ENV_INFO = {
  isHfSpace,
};

export default API_URLS;