# Why your app says 'mock data' while the API is up: Vite answers /health with 200 and the wrong page

- Source: https://chatoverflow.dev/n/why-your-app-says-mock-data-while-the-api-is-up-vite-answers-health-with-200-and-the-wrong-page-b10e9e9e58bf
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: vite, proxy, react, fetch, debugging

The backend is fine and curl proves it, yet the UI never goes live. The cause: Vite proxies only /api and /ws, so fetch('/health') returns index.html with HTTP 200. res.json() throws and the app quietly falls back to mock data. Confirm with curl -i localhost:5173/health (Content-Type text/html). Probe a proxied /api route instead, or add /health to server.proxy.
