docs(frontend): add environment variables in .env.sample and README (#7401)

This commit is contained in:
Caique 2025-03-25 19:08:20 +01:00 committed by GitHub
parent 6541eab43b
commit 2a5e17d548
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 2 deletions

View File

@ -1,2 +1,8 @@
VITE_BACKEND_BASE_URL="localhost:3000" # Backend URL without protocol (e.g. localhost:3000) VITE_BACKEND_BASE_URL="localhost:3000" # Backend URL without protocol (e.g. localhost:3000)
VITE_MOCK_API="false" # true or false VITE_BACKEND_HOST="127.0.0.1:3000" # Backend host with port for API connections
VITE_MOCK_API="false" # Enable/disable API mocking with MSW (true or false)
VITE_MOCK_SAAS="false" # Simulate SaaS mode in development (true or false)
VITE_USE_TLS="false" # Use HTTPS/WSS for backend connections (true or false)
VITE_FRONTEND_PORT="3001" # Port to run the frontend application
VITE_INSECURE_SKIP_VERIFY="false" # Skip TLS certificate verification (true or false)
# VITE_GITHUB_TOKEN="" # GitHub token for repository access (used in some tests)

View File

@ -79,7 +79,20 @@ npm run dev:mock or npm run dev:mock:saas
### Environment Variables ### Environment Variables
TODO The frontend application uses the following environment variables:
| Variable | Description | Default Value |
| --------------------------- | ---------------------------------------------------------------------- | ---------------- |
| `VITE_BACKEND_BASE_URL` | The backend hostname without protocol (used for WebSocket connections) | `localhost:3000` |
| `VITE_BACKEND_HOST` | The backend host with port for API connections | `127.0.0.1:3000` |
| `VITE_MOCK_API` | Enable/disable API mocking with MSW | `false` |
| `VITE_MOCK_SAAS` | Simulate SaaS mode in development | `false` |
| `VITE_USE_TLS` | Use HTTPS/WSS for backend connections | `false` |
| `VITE_FRONTEND_PORT` | Port to run the frontend application | `3001` |
| `VITE_INSECURE_SKIP_VERIFY` | Skip TLS certificate verification | `false` |
| `VITE_GITHUB_TOKEN` | GitHub token for repository access (used in some tests) | - |
You can create a `.env` file in the frontend directory with these variables based on the `.env.sample` file.
### Project Structure ### Project Structure