chore: handle DASHBOARD_API_BASE_URL env at docker run time #1231
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.
In order to allow the users to specify the dashboard base api url (by default it is
http://localhost:8989
) we can add a docker envDASHBOARD_API_BASE_URL
that the users can use to set dashboard api base url in the UI.Rather than using sed for replace the env var in the js file, we can use
envsubst
through the index.html that includes the env var used in the UI for handle the API requests.If custom env var,
DASHBOARD_API_BASE_URL
, miss the default base path,http://localhost:8989
, will be used.The UI is already updated and able to handle the env var.
All the changes are backward compatible.
Discord thread
Custom dashboard api base url
Set the env DASHBOARD_API_BASE_URL="https://api.example.com", all the request will have
https://api.example.com
as base path.Kapture.2025-03-05.at.15.31.52.mp4