sat-utils/sat-api

add envvar for sat-utils URL

matthewhanson opened this issue · 1 comments

The API lambda attempts to get the request URL (base URL + prefix) from the headers.

This logic works for sat-api.developmentseed.org the way the CNAME is set up, but does not for earth-search.aws.element84.com which uses the API Gateway custom domain. Evidently the header fields are different.

The current logic can stay in place, but we should also define a SATAPI_URL environment variable which, if set, will be used. Otherwise it can continue to get the info from the header. This will be used to construct all hierarchical links in returned catalogs, collections, and items.

This is also useful if you want to proxy sat-api, such as if compositing it into another API. It provides a way to specify that actual URL that should be used to generate links.