docs: update Vite staging proxy instructions

This commit is contained in:
u1
2026-01-08 06:00:23 +00:00
parent 545e1abfaa
commit 9420c89f52

View File

@@ -18,13 +18,14 @@ Najprościej: trzymaj `VITE_API_URL=/api` i podepnij Vite proxy do VPS (żeby ni
```bash
cd apps/visualizer
API_PROXY_TARGET=https://trade.rv32i.pl/api \
API_PROXY_BASIC_AUTH='USER:PASS' \
API_PROXY_TARGET=https://trade.mpabi.pl \
npm run dev
```
Zamiast `API_PROXY_BASIC_AUTH` możesz użyć pliku JSON z polami `username`/`password`:
`API_PROXY_BASIC_AUTH_FILE=tokens/frontend.json`.
Vite proxyuje wtedy: `/api/*`, `/whoami`, `/auth/*`, `/logout` do VPS. Dodatkowo w dev usuwa `Secure` z `Set-Cookie`, żeby sesja działała na `http://localhost:5173`.
Jeśli staging jest dodatkowo chroniony basic auth (np. Traefik `basicAuth`), ustaw:
`API_PROXY_BASIC_AUTH='USER:PASS'` albo `API_PROXY_BASIC_AUTH_FILE=tokens/frontend.json` (pola `username`/`password`).
## Docker