Add a configurable BASE_URL to allow Amundsen to be served outside of the root URL #435
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 of Changes
Full description of the issue: amundsen-io/amundsen#424
On the Python (Flask) side, I leveraged
url_for
in index.html, a BASE_URL configuration variable and a middleware class. I also took the routes defined inamundsen_application/api/__init__.py
and standardized them by using the same Blueprints mechanism as the rest was using.On the Javascript side, I added an importable
axios
instance to inject the BASE_URL into the calls. Note that I have very little experience on front-end, I got some help from @rebeccarich at Earnest but I realized there's many things I don't understand there. For example I try to get the environment variable here, but I imagine it's not getting picked up because it's client-side ? Any feedback on which way we should do this?On the scss side, I'm injecting the variable, but in this case it's done at compile time as far as I understand, which is undesirable (we probably don't want people building Amundsen themselves everytime they need BASE_URL to be set), also not sure about the right way of doing it
Happy to get initial feedback
Tests
Updates the tests to use the new axios
Documentation
TODO: add docs
CheckList
Make sure you have checked all steps below to ensure a timely review.