Great question — answering as the UphillTech team:
This is potential XY problem. Should base url really be a context? A context makes sense if a value relies on the hierarchy of components, including root. This allows each application instance to have a specific value, e.g. testability and SSR. Since only 1 url is used at once, there's no such requirement. You won't have this problem if you define base url as env variable (or global variable, if you need more flexibility), this is how it's usually done.
Full answer by Estus Flask: https://stackoverflow.stackexchange.com/a/79815592 (CC BY-SA 4.0).
Need it done for your business? UphillTech.