Skip to content

Use NEXT_PUBLIC_BASE_URL for public config#1

Merged
theNEXlevel merged 1 commit into
mainfrom
fix-public-base-url
Jul 3, 2026
Merged

Use NEXT_PUBLIC_BASE_URL for public config#1
theNEXlevel merged 1 commit into
mainfrom
fix-public-base-url

Conversation

@theNEXlevel

Copy link
Copy Markdown
Contributor

What

Replaces the scaffolded NEXT_PUBLIC_API_URL / NEXT_PUBLIC_VAPID_PUBLIC_KEY build args (carried over from the template repo) with NEXT_PUBLIC_BASE_URL — the variable the app actually reads.

Why

Neither NEXT_PUBLIC_API_URL nor NEXT_PUBLIC_VAPID_PUBLIC_KEY is referenced anywhere in the codebase. utils/auditLogger.js reads NEXT_PUBLIC_BASE_URL to build absolute API URLs for server-side calls, defaulting to http://localhost:3000.

Changes

  • Dockerfile: NEXT_PUBLIC_BASE_URL build arg (NEXT_PUBLIC_* is inlined at build time), dead VAPID arg removed
  • docker-compose.yml: build arg + runtime fallback use NEXT_PUBLIC_BASE_URL
  • example.env: documents NEXT_PUBLIC_BASE_URL (no trailing slash, no /api suffix)

Verified: docker build --build-arg NEXT_PUBLIC_BASE_URL=https://va-stats-test.c4g.dev succeeds and the value is inlined into the built server bundle.

🤖 Generated with Claude Code

The scaffolded NEXT_PUBLIC_API_URL/NEXT_PUBLIC_VAPID_PUBLIC_KEY were carried
over from the template but are not referenced anywhere in the app. The code
(utils/auditLogger.js) reads NEXT_PUBLIC_BASE_URL to build absolute API URLs
server-side. Replace the dead vars with NEXT_PUBLIC_BASE_URL as a build arg
(NEXT_PUBLIC_* is inlined at build time) plus a runtime fallback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@theNEXlevel theNEXlevel merged commit 2d701c8 into main Jul 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant