This code:
|
if (window.location.port === "8080") { |
|
return `${window.location.protocol}//${window.location.hostname}`; |
|
} |
... handles selecting the correct data for the given environment IFF we're running in a docker-compose style deployment.
However, we also deploy to pre-production Drupal environments as an NPM package, in which case the default production data URL is used. We should be able to detect that we're in an integration.*.nsidc.org URL and select the corresponding pre-production data URL, e.g. https://integration.nsidc.org/api/snow-today.