| const hostname = window.location.hostname; | |
| // Local modes: ng serve, localhost, or IP on local network | |
| const isLocal = | |
| hostname === 'localhost' || | |
| hostname === '127.0.0.1' || | |
| hostname.startsWith('192.168.') || | |
| hostname.startsWith('10.'); | |
| // Decide API URL based on where the app is running | |
| const pyDetectApiUrl = isLocal | |
| ? 'http://127.0.0.1:5002' // your local Flask | |
| : 'https://pykara-Py-detect-backend.hf.space'; // Hugging Face backend | |
| export const environment = { | |
| production: !isLocal, | |
| pyDetectApiUrl | |
| }; | |