Skip to content

Conversation

@zhangolve
Copy link

@zhangolve zhangolve commented Jan 14, 2026

Fix local dev when .env is missing by adding a fallback public TRADFI API endpoint.

Summary by CodeRabbit

Bug Fixes

  • Improved API connection reliability by adding a default fallback URL, ensuring the application functions properly even when environment configuration is missing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

The TRADFI_API constant in src/constants/index.ts was updated to include a fallback default URL. When the environment variable is unset, the constant now defaults to 'https://tradfi.llama.fi' instead of being undefined.

Changes

Cohort / File(s) Summary
Configuration Fallback
src/constants/index.ts
Added nullish coalescing operator to provide default URL ('https://tradfi.llama.fi') for TRADFI_API when environment variable is not set

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A tiny constant hops in place,
With fallback values, just in case,
When env vars vanish in the night,
A default URL shines bright!
One small change, a guard so nice,
No more undefined—problem sliced! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding handling for a missing TRADFI_API configuration with a fallback default.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1652c5c and 5fc30f1.

📒 Files selected for processing (1)
  • src/constants/index.ts
🔇 Additional comments (1)
src/constants/index.ts (1)

170-170: LGTM!

The fallback URL pattern is consistent with other API endpoints in this file (e.g., SERVER_URL, STABLECOINS_SERVER_URL, BRIDGES_SERVER_URL, etc.). This change improves the local development experience while maintaining the ability to override via environment variable when needed.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

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