Healy-Hyperspatial / stac-fastapi-mongo

Mongodb backend for stac-fastapi built on the stac-fastapi-elasticsearch core api library.
MIT License
6 stars 1 forks source link

How to override server's base URL #33

Open GorgiAstro opened 2 weeks ago

GorgiAstro commented 2 weeks ago

Is your feature request related to a problem? Please describe. I would like the Items in my MongoDB to keep relative URIs to their assets' COGs in case of server migration for instance.

In the current implementation, in case of a relative href for an Asset, the STAC-fastAPI server's base URL is prepended to it. However, I would like my server serving the COGs to be hosted at a different address (probably same server but different port).

Describe the solution you'd like Instead, is it possible to override the STAC-fastAPI server's base URL? I didn't find in the code where the base URL is defined, I saw base_url = get_base_url(request) but I didn't really understand that part.