From c4a27f0bac2e0d85c14629cb86652e9075cc006d Mon Sep 17 00:00:00 2001 From: Nicolaj Hartmann Date: Sun, 18 Jan 2026 03:12:45 +0100 Subject: [PATCH] Add frontend environment configuration for API URL injection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .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 --- .gitignore | 6 ++++-- frontend/.env.development | 2 ++ frontend/.env.example | 7 +++++++ frontend/.env.production | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 frontend/.env.development create mode 100644 frontend/.env.example create mode 100644 frontend/.env.production diff --git a/.gitignore b/.gitignore index 173764d..36ffa86 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/frontend/.env.development b/frontend/.env.development new file mode 100644 index 0000000..155c3f6 --- /dev/null +++ b/frontend/.env.development @@ -0,0 +1,2 @@ +# Development environment defaults +VITE_GRAPHQL_ENDPOINT=http://localhost:5000/graphql diff --git a/frontend/.env.example b/frontend/.env.example new file mode 100644 index 0000000..6b6814c --- /dev/null +++ b/frontend/.env.example @@ -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 diff --git a/frontend/.env.production b/frontend/.env.production new file mode 100644 index 0000000..f48dbb8 --- /dev/null +++ b/frontend/.env.production @@ -0,0 +1,2 @@ +# Production environment - uses relative path (proxied by nginx/ingress) +VITE_GRAPHQL_ENDPOINT=/graphql