Package Exports
- @digifi/app-config-loader
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@digifi/app-config-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
App-Config-Loader

Takes db config from either the Azure Key Vault or .env file and returns app configuration for the periodic app.
Required secrets (.env variables) are:
- CloudProvider ('AWS' or 'Azure')
- MongoUrl (string)
- MongoReplicasetName (string)
Optional secrets (.env variables) are:
- ProjectName (string, defaults to 'Sample App')
- Environment (string, defaults to 'development')
- MongoServerKeepAlive (0 or 1, defaults to 1)
- MongoUseNewUrlParser (0 or 1, defaults to 0)
- MongoConnectTimeout (milliseconds, defaults to 30000)
- MongoSocketTimeout (milliseconds, defaults to 30000)
Getting Started
To begin using the app-config-loader, install the module by running the following command:
$ npm install @digifi/app-config-loader --saveUsage
After installing the app-config-loader, require the module at the top of files where you would like to use it.
const appConfigLoader = require('@digifi/app-config-loader');Mongo configuration can be retrived using
const mongoConfiguration = appConfigLoader.getMongoConfiguration();Other secrets can be retrived using
const someSecret = appConfigLoader.getSecret('SomeSecret');Example Config
Example .env
CloudProvider=AWS
ProjectName=Test App Config
Environment=development
MongoUrl=mongodb://localhost:27017/config_db
MongoReplicasetName=SOME-shard-0
MongoServerKeepAlive=1
MongoUseNewUrlParser=1
MongoConnectTimeout=30000
MongoSocketTimeout=30000