fix(ui): use runtime ROOT_PATH for API base URL (#95)#96
Merged
Conversation
added 2 commits
April 8, 2026 05:41
… env (#95) Add entrypoint.sh that generates config.js with ROOT_PATH at container startup, so the UI can discover the API prefix without rebuilding.
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
Fixes #95 — The React UI was not using
ROOT_PATHwhen making API calls, causing 404 errors behind a reverse proxy with a path prefix (e.g.,/ep-api).Changes
entrypoint.sh(new): Generates/app/ui/build/config.jsat container startup with theROOT_PATHvalue from the environmentui/public/index.html: Loadsconfig.jsbefore the React app startsui/src/services/api.js: Reads base URL fromwindow.__EP_CONFIG__.rootPathinstead of build-timeREACT_APP_API_BASE_URLDockerfile.allinone: Usesentrypoint.shinstead of launching supervisord directlyHow it works
entrypoint.shrunswindow.__EP_CONFIG__ = { rootPath: "/ep-api" };to/app/ui/build/config.jsindex.htmlloads this script before React bootsapi.jspicks up the rootPath as the axios base URLTo change the prefix, just update
ROOT_PATHin.envand restart — no rebuild needed.Test plan
entrypoint.shconfig.jsis generated with correctROOT_PATHvalue