JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 699
  • Score
    100M100P100Q86974F
  • License Apache

Config loader for DigiFi Applications

Package Exports

  • @digifi/app-config-loader
  • @digifi/app-config-loader/dist/index.js

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 Build Status Coverage Status

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 --save

Usage

After installing the app-config-loader, require/import the module at the top of files where you would like to use it.

const appConfigLoader = require('@digifi/app-config-loader');
import appConfigLoader from '@digifi/app-config-loader';

Other secrets can be retrived using

const someSecret = appConfigLoader.getSecret('SomeSecret');

#### Example Config

Example .env

MongoUrl=mongodb://localhost:27017/db_name JwtSecret= RedisUrl= EncryptSecret= JwtSecretDefaultSessionSecret= Port= LogsLevel=