Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Local development frontend API calls failing

Aperta
#446 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@sahilds1 ci sta già lavorando.

Dal 20/1/2026.

  • #447 di @sahilds1 — integrata

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Bug

Steps to Reproduce

  1. Start local Docker environment: docker compose up
  2. Navigate to frontend at http://localhost:3000
  3. Trigger any API call (e.g., fetch medication list)
  4. 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CodeForPhilly/balancer-main

Tutte le issue di CodeForPhilly/balancer-main

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.