Configure Vite dev proxy via VITE_BACKEND_URL
This commit is contained in:
@@ -595,7 +595,7 @@ Do **not** add a Content-Security-Policy meta tag; CSP should be set as an HTTP
|
||||
|
||||
---
|
||||
|
||||
### TASK-029 — Configure Vite proxy target via environment variable
|
||||
### TASK-029 — Configure Vite proxy target via environment variable (done)
|
||||
|
||||
**Where found:** `frontend/vite.config.ts` line 31 — `target: "http://backend:8000"` is a hardcoded Docker service hostname.
|
||||
|
||||
|
||||
@@ -135,9 +135,13 @@ frontend/
|
||||
```
|
||||
|
||||
> **Dev proxy target:** `vite.config.ts` proxies all `/api` requests to
|
||||
> `http://backend:8000`. Use the compose **service name** (`backend`), not
|
||||
> `localhost` — inside the container network `localhost` resolves to the
|
||||
> frontend container itself and causes `ECONNREFUSED`.
|
||||
> `http://backend:8000` by default. Set `VITE_BACKEND_URL` in `frontend/.env`
|
||||
> or your shell to override the backend address for local development outside
|
||||
> Docker.
|
||||
>
|
||||
> Use the compose **service name** (`backend`), not `localhost` — inside the
|
||||
> container network `localhost` resolves to the frontend container itself and
|
||||
> causes `ECONNREFUSED`.
|
||||
|
||||
### Separation of Concerns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user