The default configuration file is meant to be a template that can be copied and pasted to an environment name like production.js or local.js (see the node-config module docs for more info). The logic that is in that file complicates the structure and detracts from the simplicity that a config file should have.
If we want the config validation to be in its own file, we can use a simple module pattern to do that, like validateConfig(config) or something. As far as I'm concerned though, we can just validate the configuration inline in the main entry file.
The default configuration file is meant to be a template that can be copied and pasted to an environment name like
production.js
orlocal.js
(see the node-config module docs for more info). The logic that is in that file complicates the structure and detracts from the simplicity that a config file should have.If we want the config validation to be in its own file, we can use a simple module pattern to do that, like
validateConfig(config)
or something. As far as I'm concerned though, we can just validate the configuration inline in the main entry file.