Download frontend-react/src/api.ts from anky2002/graph-rag: direct link, hf CLI and curl.
- Browser
- Download file 717 Bytes
-
https://huggingface.co/spaces/anky2002/graph-rag/resolve/main/frontend-react/src/api.ts
- Command line
-
hf download hf://spaces/anky2002/graph-rag/frontend-react/src/api.ts
-
curl -L -o api.ts https://huggingface.co/spaces/anky2002/graph-rag/resolve/main/frontend-react/src/api.ts
717 Bytes
| /** | |
| * Central API base URL. | |
| * | |
| * Production (Docker / Hugging Face Space): the built React app is served by | |
| * the FastAPI backend from the SAME origin (port 7860), so a relative `/api` | |
| * is correct — no host/port is hardcoded, which was previously breaking the | |
| * Space (it defaulted to `http://localhost:8000/api`, i.e. the *user's* machine). | |
| * | |
| * Local development: Vite proxies `/api` → `http://localhost:8000` (see | |
| * vite.config.ts), so `/api` also works under `npm run dev`. | |
| * | |
| * Set VITE_API_BASE_URL at build time to point at a different backend if you | |
| * ever host the frontend separately from the API. | |
| */ | |
| export const API_BASE = (import.meta.env.VITE_API_BASE_URL || '/api').replace(/\/+$/, ''); | |