Environments
Environments are vital to run the app with different configurations based on the context where the App is running. Usually we should have at least four envs:
tom-enviroment: used by the dev to develop on his local machine. The robots / automations are disabled / payments are sandboxed, mails are sandboxed
remote-development this env contains the same settings of a developer environment but is hosted in the cloud. This env will hit the development api
staging: This is the env where the client and our QA can run tests, find bugs and test new features. Usualli this endpoint is visible to the client. In this env the automations runs, it sends emails, robots / automation runs, payments are with fake credit card / sandboxed
production: This could be the client production environment where of course everything is set in produciton mode (delete operation / mails / payments) We could also decide to have a clone of the client produciton env to do a rollout in our machine before to go live in the client machines.
How to deal with those?
Inside an Angular project we have a folder src/environments where we can add a file for every environment that we need to support eg: src/environments/environment.production.ts src/environments/environment.development.ts etc...
These envs are included in the version control (GIT)
There is one that is called src/environments/environment.ts which is your local (for local development) env file and this is not added to GIT, so when you start a project you have to create that.
IMPORTANT
To show other devs all the vars that are needed for local (or other) dev please add vars also to dev-evnvironment.example.ts
Last updated
Was this helpful?