tfrere commited on
Commit
f3d46ba
·
1 Parent(s): b4d058e
Files changed (1) hide show
  1. client/src/config/api.js +5 -3
client/src/config/api.js CHANGED
@@ -4,11 +4,13 @@ const isHfSpace =
4
  window.location !== window.parent.location;
5
 
6
  // Get the base API URL based on the environment
7
- const API_BASE_URL = isHfSpace ? "/api" : "http://localhost:3002/api";
 
 
8
 
9
  export const API_URLS = {
10
- leaderboards: `${API_BASE_URL}/leaderboards`,
11
- health: `${API_BASE_URL}/health`,
12
  };
13
 
14
  // Export additional environment info
 
4
  window.location !== window.parent.location;
5
 
6
  // Get the base API URL based on the environment
7
+ const API_BASE_URL = isHfSpace
8
+ ? `${window.location.origin}` // En production (HF Space), on utilise l'URL racine
9
+ : "http://localhost:3002/api"; // En développement
10
 
11
  export const API_URLS = {
12
+ leaderboards: `${API_BASE_URL}/api/leaderboards`,
13
+ health: `${API_BASE_URL}/api/health`,
14
  };
15
 
16
  // Export additional environment info