Local development frontend API calls failing
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Steps to Reproduce
- Start local Docker environment:
docker compose up - Navigate to frontend at
http://localhost:3000 - Trigger any API call (e.g., fetch medication list)
- Observe error in browser console and Vite terminal
Possible Fix: Vite proxy
Background
The API client uses relative URLs (/api/...), so requests go to the frontend's origin unless a proxy forwards them to the backend. In development, Vite runs a Node.js server that serves the React app and can proxy requests. In production, Vite compiles React into static files served by nginx or a CDN — the infrastructure handles API routing instead.
Fix
Add a proxy to frontend/vite.config.ts:
server: {
proxy: {
'/api': {
target: 'http://backend:8000',
changeOrigin: true,
},
},
},
Rebuild with docker compose down && docker compose up --build.
- Lingua principale
- TypeScript
- Stelle
- 21
- Fork
- 18
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CodeForPhilly/balancer-main
-
Rename the "Click to Enter New Patient" Button to say "Enter New Patient"Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. ApertaBug
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
CodeForPhilly/balancer-main#509 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
CodeForPhilly/balancer-main#503 ·
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CodeForPhilly/balancer-main#502 · 1 commento ·
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
CodeForPhilly/balancer-main#488 ·
-
Documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
CodeForPhilly/balancer-main#478 ·
Tutte le issue di CodeForPhilly/balancer-main
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
better-auth/better-auth#11723 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
area: docs difficulty: easy documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Worker-Erstellung bricht langsame Git-Worktree-Checkouts nach 20 Sekunden abForse già presa @KajoVanBuyten l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
AgentSystemLabs/agent-office#367 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pierrecomputer/pierre#1187 ·
I maintainer di solito rispondono entro 1 giorno
-
area: frontend bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
snapotter-hq/SnapOtter#2425 ·
I maintainer di solito rispondono entro 1 giorno