Skip to content

refactor: drop VITE_API_BASE_URL, always use relative /api - #257

Merged
a-mandala merged 5 commits into
mainfrom
refactor/drop-vite-api-base-url
Aug 27, 2026
Merged

refactor: drop VITE_API_BASE_URL, always use relative /api#257
a-mandala merged 5 commits into
mainfrom
refactor/drop-vite-api-base-url

Conversation

@a-mandala

Copy link
Copy Markdown
Collaborator

Summary

The frontend no longer reads VITE_API_BASE_URL. It always targets the relative /api path.

  • web/src/lib/env.ts: hardcode API_BASE_URL = "/api"
  • web/vite.config.ts: dev proxy forwards /api to http://127.0.0.1:3000 so npm run dev works against cargo run with zero configuration
  • Remove the variable (and now-pointless build arg plumbing) from backend/Dockerfile, docker-compose.build.yml, CI workflow, and delete web/.env.example
  • Update both READMEs accordingly

Rationale

The backend serves the bundled frontend on the same origin and exposes its API under /api, so build-time URL configurability was dead weight that forced a rebuild per environment. Hosting the API on a separate origin is still possible with a reverse proxy forwarding /api.

Validation

  • npm run lint: OK
  • npm run typecheck: OK
  • npm test: 84/84 passing
  • npm run build: OK
  • Docker image build not exercised locally; CI will cover it.

Drop the VITE_API_BASE_URL read; the frontend now always targets the
relative /api path served by the backend on the same origin.
Also removes the obsolete .env.example reference in the root README.
@a-mandala
a-mandala merged commit 406679d into main Aug 27, 2026
4 checks passed
@a-mandala
a-mandala deleted the refactor/drop-vite-api-base-url branch August 27, 2026 11:38
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.

2 participants