dbrand666 / usmobile-lifeguard

Minds your USMobile pool so you don't have to
GNU General Public License v3.0
15 stars 2 forks source link

Support configuration via env vars #1

Closed matthewadams closed 1 year ago

matthewadams commented 1 year ago

A more portable way to configure the app would be via environment variables, so that I can use secrets (for my token) in different runtime environments (k8s, fly.io, railway.app, heroku, etc).

To preserve backward compatibility, you can check to see if the file exists before loading; if it doesn't, return an empty object. Then, when checking the config, if a config value doesn't exist, check an environment variable for it, then throw if there's no reasonable default value.