Allow setting a prefix path for the client #244
Draft
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.
The point of this feature is to support deploying a map at a subpath instead of the root path of a domain. For example, if an organization has a new map each year, but wants all maps to be available on the same domain:
This would be achieved by using a reverse proxy like nginx at https://sampleorg.com/ that routes the traffic at each path to the appropriate place.
Setup
'BASE_URL'
value to the settings, or aBASE_URL
environment variable.Other designs considered
We could have allowed multiple maps built to pull from different datasets to be accessed from multiple paths. The flavor and dataset is currently determined globally by the
SHAREABOUTS
dictionary in the Django settings (frequently set by environment variables). Instead of having global settings, we could make these settings path-specific -- something like:And for backwards compatibility, if
FLAVOR
andDATASET_ROOT
are set at the top level of the dictionary, then everything works as it currently does. This is still something that could be done in the future, and would be possible in part by the work in this PR.There are also drawbacks to the above alternative:
cycle1
version of the site would have to be updated to work with any code changes that happen in thecycle2
andcycle3
sites (as long as all of the customization happens in the specific flavor apps that's doable).Needing to set up a reverse proxy in order to use this feature is introducing additional complication, but I think it is the most flexible way to achieve the feature, and puts in place concepts (like arbitrary site prefixes) that can be used in the future.