Available variables
VITE_API_URL
VITE_API_URL sets the base URL that the frontend uses when making API requests. It is read in src/app/api.ts:
http://localhost:5175.
Local development
During local development you do not need to setVITE_API_URL. Vite’s dev server proxies all requests that start with /api to http://localhost:5175, so the frontend and backend communicate through the proxy without cross-origin issues.
This proxy is configured in vite.config.ts:
The Vite dev server runs on port 5173 and the backend is expected on port 5175.
Production
In production there is no Vite dev server, so the proxy is not available. You must setVITE_API_URL to the public URL of your deployed backend before building.
Setting variables in a .env file
Create a.env file in the project root for local overrides. Vite loads this file automatically.
