Spaces:
Sleeping
Sleeping
fix
Browse files
frontend/src/services/api.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
|
|
|
|
|
| 1 |
const baseURL =
|
| 2 |
-
import.meta.env.VITE_API_BASE_URL
|
|
|
|
|
|
|
| 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;
|