Use NEXT_PUBLIC_BASE_URL for public config#1
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the scaffolded
NEXT_PUBLIC_API_URL/NEXT_PUBLIC_VAPID_PUBLIC_KEYbuild args (carried over from thetemplaterepo) withNEXT_PUBLIC_BASE_URL— the variable the app actually reads.Why
Neither
NEXT_PUBLIC_API_URLnorNEXT_PUBLIC_VAPID_PUBLIC_KEYis referenced anywhere in the codebase.utils/auditLogger.jsreadsNEXT_PUBLIC_BASE_URLto build absolute API URLs for server-side calls, defaulting tohttp://localhost:3000.Changes
NEXT_PUBLIC_BASE_URLbuild arg (NEXT_PUBLIC_*is inlined at build time), dead VAPID arg removedNEXT_PUBLIC_BASE_URLNEXT_PUBLIC_BASE_URL(no trailing slash, no/apisuffix)Verified:
docker build --build-arg NEXT_PUBLIC_BASE_URL=https://va-stats-test.c4g.devsucceeds and the value is inlined into the built server bundle.🤖 Generated with Claude Code