fix: require explicit API base URL with environment validation (closes #13) - #114
Open
cwjcwj95 wants to merge 1 commit into
Open
fix: require explicit API base URL with environment validation (closes #13)#114cwjcwj95 wants to merge 1 commit into
cwjcwj95 wants to merge 1 commit into
Conversation
Replace implicit localhost fallback with explicit env validation: - Production builds fail fast when VITE_API_BASE_URL is missing - Development retains intentional localhost default with console warning - Add normalizeBaseUrl() to prevent double slashes - Add ApiConfigurationError for clear config failures Closes jaxassistant55#13
|
/claim |
Author
|
Hi @lizhiming454, This PR was submitted by me (@cwjcwj95) to resolve issue #13. The implementation:
The changes are complete and ready for review. Please let me know if any adjustments are needed. |
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.
Summary
This PR replaces the implicit localhost fallback in the API client with explicit environment validation, as requested in the bounty.
Changes
ApiConfigurationErrorwhenVITE_API_BASE_URLis missing.normalizeBaseUrl()to prevent double slashes when the configured URL has trailing or duplicate slashes.Acceptance Criteria
python3 build.py)Required Validation
python3 build.py✅.logdartifact fromdiagnostic/build-XXX.logd(attached)/claim #13