Fix LAN API access and dev proxy routing
This commit is contained in:
@@ -116,10 +116,9 @@ Frontend runtime API target:
|
||||
- `VITE_API_BASE` in `docker-compose.yml` frontend service (optional override)
|
||||
- `VITE_API_TOKEN` in `docker-compose.yml` frontend service (optional compatibility fallback only)
|
||||
|
||||
When `VITE_API_BASE` is unset, frontend API helpers resolve the backend URL dynamically as:
|
||||
- `http://<current-frontend-hostname>:8000/api/v1`
|
||||
When `VITE_API_BASE` is unset, frontend API helpers call relative `/api/v1` paths and the Vite dev server proxy forwards requests to `VITE_DEV_PROXY_TARGET` (defaults to `http://api:8000` in docker-compose).
|
||||
|
||||
This keeps development access working when the UI is opened through a LAN IP instead of `localhost`.
|
||||
This avoids browser cross-origin/CORS failures for LAN-hosted development.
|
||||
|
||||
Frontend API authentication behavior:
|
||||
- `frontend/src/lib/api.ts` resolves bearer tokens at request time in this order:
|
||||
|
||||
Reference in New Issue
Block a user