refactor: drop VITE_API_BASE_URL, always use relative /api - #257
Merged
Conversation
Drop the VITE_API_BASE_URL read; the frontend now always targets the relative /api path served by the backend on the same origin.
Lets work against without any env var.
Also removes the obsolete .env.example reference in the root README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The frontend no longer reads
VITE_API_BASE_URL. It always targets the relative/apipath.web/src/lib/env.ts: hardcodeAPI_BASE_URL = "/api"web/vite.config.ts: dev proxy forwards/apitohttp://127.0.0.1:3000sonpm run devworks againstcargo runwith zero configurationbackend/Dockerfile,docker-compose.build.yml, CI workflow, and deleteweb/.env.exampleRationale
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: OKnpm run typecheck: OKnpm test: 84/84 passingnpm run build: OK