Currently we have nconf set up to read in environment variables. This works fine in production because we use Docker Swarm Secrets.
However, when developing locally or running tests, it's becoming annoying to have to set these environment variables on top of remembering which there are and which ones are set.
We could use dotenv to read in environment variables from a ".env" file, but my personal preference is envalid which is a wrapper around dotenv that allows you to define what type the vars should be and give them default values.
This task is complete when envalid is integrated into the API and there is a .env-sample file defined with the necessary env vars (but with blank values) to run the API.
Currently we have
nconfset up to read in environment variables. This works fine in production because we use Docker Swarm Secrets.However, when developing locally or running tests, it's becoming annoying to have to set these environment variables on top of remembering which there are and which ones are set.
We could use dotenv to read in environment variables from a ".env" file, but my personal preference is envalid which is a wrapper around
dotenvthat allows you to define what type the vars should be and give them default values.This task is complete when
envalidis integrated into the API and there is a.env-samplefile defined with the necessary env vars (but with blank values) to run the API.