Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

Override the API_ROOT in production builds using environment variables #107

Open
simbo1905 opened this issue Apr 23, 2018 · 0 comments
Open

Comments

@simbo1905
Copy link

The readme says to edit the src/agent.js to change the API_ROOT to point to a different backend api instance. We want to set things up so that API_ROOT can be defined by an environment variable that is different for the multiple environments(e.g., “staging” and “live”) where we run the production build.

We are running in containers on openshift kubernetes following 12factor.net principles where the code is built once then promoted through environments. We can spin up new new environments with a single command so we don’t want to have a switch statement within the code that names each environment and hardcodes the backend API_ROOT for each environment. Instead I want to be able to run an existing production build container image in a fresh environment where I have change the API_ROOT to point to the correct backend API that has the data we want to test against.

I have asked about the best way to do this on stackoverflow.com at https://stackoverflow.com/q/49975735/329496

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant