centralize API base selection and environment-aware fetching - #305
Open
veemakama wants to merge 2 commits into
Open
centralize API base selection and environment-aware fetching#305veemakama wants to merge 2 commits into
veemakama wants to merge 2 commits into
Conversation
### Changes Made: 1. Centralized API URL Handling : Updated src/lib/api.ts with three typed functions for consistent URL handling: - getRustAcademyApiBase() : Public/browser API base URL - getRustAcademyInternalApiBase() : Server-side/internal API base URL - getSiteUrl() : For OpenGraph metadata and site links (with fallback logic) 2. Updated src/lib/og-metadata.ts : Replaced direct environment variable usage and duplicate getSiteUrl() implementation with the centralized functions. ### Impacted Files Check: - ✅ app/frontend/src/lib/api.ts : Updated with centralized functions - ✅ app/frontend/src/app/settings/developer/page.tsx : Already using getRustAcademyApiBase() - ✅ app/frontend/src/components/admin/AuditLogs.tsx : Already using getRustAcademyApiBase() - ✅ app/frontend/src/components/admin/FeatureFlags.tsx : Already using getRustAcademyApiBase() - ✅ app/frontend/src/lib/errorReporter.ts : No API base URL usage - ✅ app/frontend/next.config.ts : Just passes through environment variables (no duplication) The codebase now has a single source of truth for API base URLs, preventing inconsistent environments!
Contributor
|
@veemakama |
Updated file project
4 tasks
MaryammAli
pushed a commit
that referenced
this pull request
Jul 23, 2026
- Add comprehensive fee configuration section to README.md explaining: * Fee resolution priority (per-asset > oracle > global) * Global fee configuration with examples * Per-asset fee overrides and use cases * Arbiter splits (both legacy and explicit FeeRatio) * Collector rotation mechanism * Fee breakdown structure - Create FEE_CONFIGURATION_GUIDE.md with: * Detailed examples for all fee configuration patterns * Common use cases and patterns * Troubleshooting guide * FeeRatio validation rules - Enhance inline documentation in lib.rs: * Add detailed docstrings for set_fee_config() * Expand set_per_asset_fee() with priority order, fee distribution, and examples * Add clear documentation for get_per_asset_fee() - Enhance admin.rs documentation: * Document set_fee_config() with fallback priority * Document set_per_asset_fee() with fee split options and validation * Add comprehensive error cases This fully surfaces the per-asset fee override functionality that was previously declared in storage but not well-documented or easily discoverable. Fixes: Issue #305 (Fee Router v2 - per-asset overrides now fully documented)
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.
Changes Made:
Centralized API URL Handling : Updated src/lib/api.ts with three typed functions for consistent URL handling:
Updated src/lib/og-metadata.ts : Replaced direct environment variable usage and duplicate getSiteUrl() implementation with the centralized functions. ### Impacted Files Check:
Closes #291