Replace .hjson with a JSON-schema. JSON-schema will allow for defining defaults as well as adding descriptions of the variables. Users can use a CONFIG environment variable to specify a JSON file with values. If no file is specified, the app will use all the defaults. If a file is specified, the app will use those values along with defaults for any missing values.
Build app config object
Use a config.js file in the app. The file will build and export a config object. The object will give priority in this order:
Environment variables that match the names of config properties.
Values from the JSON file pointed to by the CONFIG environment variable.
Defaults from the JSON schema.
The resulting object should be validated using a JSON schema validator.
Use JSON Schema for config file
Replace
.hjson
with a JSON-schema. JSON-schema will allow for defining defaults as well as adding descriptions of the variables. Users can use aCONFIG
environment variable to specify a JSON file with values. If no file is specified, the app will use all the defaults. If a file is specified, the app will use those values along with defaults for any missing values.Build app config object
config.js
file in the app. The file will build and export a config object. The object will give priority in this order:CONFIG
environment variable.The resulting object should be validated using a JSON schema validator.
Replace config references in the codebase