Add frontend environment configuration for API URL injection

- .env.example: Documentation template
- .env.development: Local dev defaults (localhost:5000)
- .env.production: Production defaults (relative /graphql path)
- Updated .gitignore to track non-secret env files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nicolaj Hartmann 2026-01-18 03:12:45 +01:00
parent 66f6fa138d
commit c4a27f0bac
4 changed files with 15 additions and 2 deletions

6
.gitignore vendored
View file

@ -169,9 +169,11 @@ $RECYCLE.BIN/
# Environment & Secrets
# ============================================
.env
.env.*
.env.local
.env.*.local
!.env.example
!.env.*.example
!.env.development
!.env.production
*.pem
*.key
*.p12

View file

@ -0,0 +1,2 @@
# Development environment defaults
VITE_GRAPHQL_ENDPOINT=http://localhost:5000/graphql

7
frontend/.env.example Normal file
View file

@ -0,0 +1,7 @@
# Books Frontend Environment Configuration
# Copy this file to .env.local and adjust values for your environment
# GraphQL API endpoint
# Development: http://localhost:5000/graphql
# Production: /graphql (relative, proxied by nginx/ingress)
VITE_GRAPHQL_ENDPOINT=http://localhost:5000/graphql

2
frontend/.env.production Normal file
View file

@ -0,0 +1,2 @@
# Production environment - uses relative path (proxied by nginx/ingress)
VITE_GRAPHQL_ENDPOINT=/graphql