Skip to content

Refactor/centralize api config - #292

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
BharadwajKanneveti:refactor/centralize-api-config
Jun 23, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
BharadwajKanneveti:refactor/centralize-api-config

Conversation

@BharadwajKanneveti

Copy link
Copy Markdown
Contributor

Summary

  • Refactored API URL handling by centralizing all API base URL configuration into a single shared config module.
  • Replaced duplicated NEXT_PUBLIC_API_URL fallbacks across the codebase, unified the localhost default, and consolidated the cloud tracking host into a single source of truth to reduce duplication and prevent future configuration inconsistencies.

Related issue

Closes #228

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pulled the branch and ran the full suite locally — typecheck, lint (0 errors), format:check, and a production build (32/32 pages) all pass. Verified the two patterns are fully centralized: no raw NEXT_PUBLIC_API_URL reads remain outside config/api.ts (the only two leftover mentions are a self-host instruction label and a JSDoc comment), no hardcoded api.ansvisor.com anywhere else, and the unified localhost default is behavior-neutral. No new env vars introduced. Clean refactor — thanks @BharadwajKanneveti! 🙌

@gkhngyk
gkhngyk merged commit 21741e9 into ansvisor:main Jun 23, 2026
3 checks passed
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.

refactor(web): consolidate API base URL into a single config helper

2 participants