Álvaro Valenzuela Valdes commited on
Commit
048a272
·
1 Parent(s): d410380

refactor: point all HF spaces to centralized personal backend

Browse files
Files changed (1) hide show
  1. frontend/lib/api.ts +3 -10
frontend/lib/api.ts CHANGED
@@ -18,18 +18,11 @@ export function getAPIBase(): string {
18
 
19
  // 2. Hugging Face Space detection (IMPROVED)
20
  if (hostname.includes('.hf.space')) {
21
- // Logic: If frontend is {user}-{space}.hf.space, backend is usually {user}-andesai-backend.hf.space
22
- // Handle the specific lablab-ai-amd-developer-hackathon organization case
23
- let backendUrl = `https://rewchile-andesai-backend.hf.space`;
24
-
25
- if (hostname.includes('lablab-ai-amd-developer-hackathon')) {
26
- backendUrl = `https://lablab-ai-amd-developer-hackathon-andesai-backend.hf.space`;
27
- } else if (hostname.includes('satori47')) {
28
- backendUrl = `https://satori47-andesai-backend.hf.space`;
29
- }
30
 
31
  console.log('[API] Hugging Face Space detected. Frontend:', hostname);
32
- console.log('[API] Connecting to Backend:', backendUrl);
33
  return backendUrl;
34
  }
35
 
 
18
 
19
  // 2. Hugging Face Space detection (IMPROVED)
20
  if (hostname.includes('.hf.space')) {
21
+ // The user prefers to centralize all traffic through their personal REWCHILE backend
22
+ const backendUrl = `https://rewchile-andesai-backend.hf.space`;
 
 
 
 
 
 
 
23
 
24
  console.log('[API] Hugging Face Space detected. Frontend:', hostname);
25
+ console.log('[API] Connecting to Centralized Backend:', backendUrl);
26
  return backendUrl;
27
  }
28