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.
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.