fix: use backend service name in Vite proxy target

Vite runs inside the frontend container where 'localhost' resolves to
the container itself, not the backend.  Change the /api proxy target
from http://localhost:8000 to http://backend:8000 so the request is
routed to the backend service over the compose network.
This commit is contained in:
2026-03-01 19:21:30 +01:00
parent c097e55222
commit e8214b5856
3 changed files with 22 additions and 3 deletions

View File

@@ -4,7 +4,18 @@ This document breaks the entire BanGUI project into development stages, ordered
---
## ✅ DONE — Issue: Setup forward
## ✅ DONE — Issue: Vite proxy ECONNREFUSED
**Problem:** The Vite dev server (running inside the frontend container) proxied
`/api` to `http://localhost:8000`. Inside the container network `localhost`
resolves to the container itself, not the backend service, causing
`AggregateError [ECONNREFUSED]` for every API call.
**Fix:** Changed `vite.config.ts` proxy target from `http://localhost:8000` to
`http://backend:8000` so Vite uses the Docker/Podman compose service DNS name
to reach the backend container over the shared network.
---
**Problem:** No DB present did not forward to setup page; setup page was not redirecting to login when already done.