pikamomo commited on
Commit
a7c9ddd
·
1 Parent(s): 6662114
Files changed (1) hide show
  1. frontend/src/services/api.ts +5 -1
frontend/src/services/api.ts CHANGED
@@ -1,5 +1,9 @@
 
 
1
  const baseURL =
2
- import.meta.env.VITE_API_BASE_URL || "http://localhost:8000";
 
 
3
 
4
  export interface ResearchRequest {
5
  topic: string;
 
1
+ // Use empty string for same-origin requests in production (HF Spaces)
2
+ // Only fallback to localhost:8000 if VITE_API_BASE_URL is truly undefined
3
  const baseURL =
4
+ import.meta.env.VITE_API_BASE_URL !== undefined
5
+ ? import.meta.env.VITE_API_BASE_URL
6
+ : "http://localhost:8000";
7
 
8
  export interface ResearchRequest {
9
  topic: string;