Configure Vite dev proxy via VITE_BACKEND_URL

This commit is contained in:
2026-04-22 20:21:20 +02:00
parent 1d41822a36
commit 1bf0645c04
4 changed files with 11 additions and 5 deletions

2
frontend/.env.example Normal file
View File

@@ -0,0 +1,2 @@
# Local frontend development without Docker
VITE_BACKEND_URL=http://localhost:8000

View File

@@ -30,7 +30,7 @@ export default defineConfig({
// In the dev compose stack the backend is reachable via its service
// name on the shared Docker/Podman network. Using "localhost" would
// resolve to the frontend container itself and cause ECONNREFUSED.
target: "http://backend:8000",
target: process.env["VITE_BACKEND_URL"] ?? "http://backend:8000",
changeOrigin: true,
},
},