Skip to content

fix: allow API base URL override#59

Open
MFA-G wants to merge 5 commits into
StepFi-app:mainfrom
MFA-G:fix-api-base-env
Open

fix: allow API base URL override#59
MFA-G wants to merge 5 commits into
StepFi-app:mainfrom
MFA-G:fix-api-base-env

Conversation

@MFA-G

@MFA-G MFA-G commented Jul 2, 2026

Copy link
Copy Markdown

Summary

  • Use VITE_API_BASE_URL when provided, while keeping the live testnet API as the default
  • Document the local override in the README
  • Add config tests for default and env-provided API base URLs

Closes #58.

Validation

  • npm test -- --run src/constants/config.test.ts passes
  • npm run build fails on existing TypeScript issues in src/services/__tests__/api.test.ts and vite.config.ts
  • npm run lint fails on existing lint issues in src/services/__tests__/api.test.ts

@EmeditWeb EmeditWeb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review verdict: ✅ APPROVE (rebase needed)

Clean, correct, and tested. API_BASE_URL = import.meta.env.VITE_API_BASE_URL ?? '<default>' is the right override pattern, and the new config.test.ts covers both the default and the override cases.

One housekeeping item: this is the oldest open PR and its branch base is stale relative to main. On checkout, eslint . reports 3 errors in src/services/__tests__/api.test.ts (an unused vi import + two any) that are not part of this change and are not present on current main — they're carried by the old base. Please rebase on the latest main so CI runs against a clean tree. Your actual change is good to merge once rebased.

(Note: the red CI on all Web PRs right now stems from a pre-existing lint error on mainsrc/services/vouching.service.ts:87 _txHash unused. Worth fixing on main, or merging #90 which happens to fix it.)

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.

fix: API_BASE_URL hardcoded without environment variable fallback

2 participants