Spaces:
Running
Running
Download Frontend/src/config.js from ritesh19180/ai-helpdesk-api: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/ritesh19180/ai-helpdesk-api/resolve/main/Frontend/src/config.js
- Command line
-
hf download hf://spaces/ritesh19180/ai-helpdesk-api/Frontend/src/config.js
-
curl -L -o config.js https://huggingface.co/spaces/ritesh19180/ai-helpdesk-api/resolve/main/Frontend/src/config.js
702 Bytes
| /** | |
| * Global Configuration for the AI Helpdesk | |
| */ | |
| const getBackendUrl = () => { | |
| const envUrl = import.meta.env.VITE_BACKEND_URL; | |
| if (envUrl) return envUrl.trim().replace(/\/$/, ''); | |
| // Dynamically deduce backend URL if running locally or on custom domain | |
| if (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') { | |
| return 'http://localhost:8000'; | |
| } | |
| // Default to the live Hugging Face Space for stability in production deployment | |
| return 'https://ritesh19180-ai-helpdesk-api.hf.space'; | |
| }; | |
| export const API_CONFIG = { | |
| BACKEND_URL: getBackendUrl(), | |
| FRONTEND_URL: window.location.origin, | |
| IS_PROD: import.meta.env.PROD | |
| }; | |