@johnmmackey/ms-utils 4.2.1 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/README.md +1 -1
- package/lib/config.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ sendmail(
|
|
|
47
47
|
* uses ```dotenv``` to load a .env file in the current working directory into the environment
|
|
48
48
|
* pushes all items loaded from etcd into the environment.
|
|
49
49
|
|
|
50
|
-
The order of precedence:
|
|
50
|
+
The order of precedence: .env > .env > externally set environment
|
|
51
51
|
|
|
52
52
|
## Future
|
|
53
53
|
* Add local queueing for log events when AMQP is not operative.
|
package/lib/config.js
CHANGED
|
@@ -33,6 +33,11 @@ async function load(serviceName) {
|
|
|
33
33
|
|
|
34
34
|
// as a side-effect, load these into process.env
|
|
35
35
|
dotenv.populate(process.env, config, { override: true });
|
|
36
|
+
|
|
37
|
+
// load any .env file that may be present into the environment
|
|
38
|
+
// again to override
|
|
39
|
+
// why? the first one may be necessary to find an etcd server...
|
|
40
|
+
dotenv.config({ override: true });
|
|
36
41
|
return config;
|
|
37
42
|
}
|
|
38
43
|
|