Álvaro Valenzuela Valdes commited on
Commit
ef5b841
·
1 Parent(s): 3e74920

fix: use absolute origin for API base to resolve 404s on HF

Browse files
Files changed (2) hide show
  1. frontend/lib/api.ts +7 -2
  2. start.sh +1 -1
frontend/lib/api.ts CHANGED
@@ -16,8 +16,13 @@ export function getAPIBase(): string {
16
  return 'http://localhost:8000';
17
  }
18
 
19
- // 3. Hugging Face & Production: Use relative paths (Monolithic mode)
20
- // This is the most stable setup for the hackathon.
 
 
 
 
 
21
  return '';
22
  }
23
 
 
16
  return 'http://localhost:8000';
17
  }
18
 
19
+ // 3. Hugging Face & Production: Use absolute origin for robustness
20
+ if (typeof window !== 'undefined') {
21
+ const origin = window.location.origin;
22
+ console.log('[ANDES-DEBUG] API Origin detected:', origin);
23
+ return origin;
24
+ }
25
+
26
  return '';
27
  }
28
 
start.sh CHANGED
@@ -1,5 +1,5 @@
1
  #!/bin/bash
2
- # Trigger build: 2026-05-07 09:02
3
 
4
  echo "--- STARTUP DEBUG INFO ---"
5
  echo "SERVICE_TYPE is: '$SERVICE_TYPE'"
 
1
  #!/bin/bash
2
+ # Trigger build: 2026-05-07 09:07
3
 
4
  echo "--- STARTUP DEBUG INFO ---"
5
  echo "SERVICE_TYPE is: '$SERVICE_TYPE'"