Parameterize the previously hardcoded API_BASE so a staging build can point at
the staging API without forking the code:
- env.js.template + /docker-entrypoint.d/30-fleetnow-env.sh render ${API_BASE}
into /env.js on container start (envsubst ships with the nginx image)
- index.html loads /env.js and uses window.FLEETNOW_API_BASE, falling back to
the prod API (https://fleetapi.rahamafresh.com) when unset — so prod/main is
unchanged; staging sets API_BASE=https://fleetapi.fivetitude.com
- nginx: serve /env.js with no-store
Enables the fleetnow.fivetitude.com staging app (Coolify, staging branch).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4 lines
275 B
Text
4 lines
275 B
Text
// Rendered at container start by /docker-entrypoint.d/30-fleetnow-env.sh
|
|
// (envsubst replaces ${API_BASE} with the API_BASE env var). If API_BASE is
|
|
// unset, this becomes an empty string and index.html falls back to the prod API.
|
|
window.FLEETNOW_API_BASE = "${API_BASE}";
|