From a4e312ad28c092ab53080b66290698dc3a7c0c82 Mon Sep 17 00:00:00 2001 From: Eduard Kyvenko Date: Thu, 10 Oct 2019 11:29:35 +0200 Subject: [PATCH] Added a bullet point on validating env vars at start-up --- sections/projectstructre/configguide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sections/projectstructre/configguide.md b/sections/projectstructre/configguide.md index 6e7b3663..df340db0 100644 --- a/sections/projectstructre/configguide.md +++ b/sections/projectstructre/configguide.md @@ -14,6 +14,8 @@ When dealing with configuration data, many things can just annoy and slow down: 4. some advanced configuration scenarios demand to inject configuration values via command line (vargs) or sync configuration info via a centralized cache like Redis so multiple servers will use the same configuration data. +5. the application should fail as fast as possible and provide the immediate feedback if the required environment variables are not present at start-up, this can be achieved by using [convict](https://www.npmjs.com/package/convict) to validate the configuration. + Some configuration libraries can provide most of these features for free, have a look at npm libraries like [rc](https://www.npmjs.com/package/rc), [nconf](https://www.npmjs.com/package/nconf) and [config](https://www.npmjs.com/package/config) which tick many of these requirements.