feat: configure UI host and port from config file - #34
joan-code6 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
LanisProject ID: Tip Sites support three domain rule types: Active deployment, Git branch, and Redirect |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 221b36496b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export const DEFAULT_API_BASE_URL = ( | ||
| import.meta.env.VITE_API_URL || 'http://localhost:8000' | ||
| ).replace(/\/+$/, ''); | ||
| export const DEFAULT_API_BASE_URL = uiConfig.apiUrl.replace(/\/+$/, ''); |
There was a problem hiding this comment.
Load apiUrl at runtime rather than bundling it
When a prebuilt dist is started with vite preview, changing config.json as README.md instructs updates the preview host and port but not the browser's API address: importing the JSON here causes Vite to inline apiUrl during vite build. This is especially problematic for a single artifact deployed to multiple environments, because every client continues using the build-time URL—by default its own localhost:8000—until the application is rebuilt. Either expose the configuration as a runtime-loaded public file or document and enforce that apiUrl must be set before building.
Useful? React with 👍 / 👎.

Summary
config.jsonfor the UI host, port, and default API URLVITE_API_URLenvironment-based configurationVerification
tsc --noEmit -p tsconfig.jsontsc --noEmit -p tsconfig.node.jsongit diff --check