fix: allow API base URL override#59
Conversation
EmeditWeb
left a comment
There was a problem hiding this comment.
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 main — src/services/vouching.service.ts:87 _txHash unused. Worth fixing on main, or merging #90 which happens to fix it.)
Summary
VITE_API_BASE_URLwhen provided, while keeping the live testnet API as the defaultCloses #58.
Validation
npm test -- --run src/constants/config.test.tspassesnpm run buildfails on existing TypeScript issues insrc/services/__tests__/api.test.tsandvite.config.tsnpm run lintfails on existing lint issues insrc/services/__tests__/api.test.ts