Dynamic, declarative configurations
Lead Maintainer: Sunny Bhanot
npm install @hapipal/confidenceSee also the API Reference
Confidence is intended for use with nodejs v12+ (see v4 for lower support).
Confidence is a configuration document format, an API, and a foundation for A/B testing. The configuration format is designed to work with any existing JSON-based configuration, serving values based on object path ('/a/b/c' translates to a.b.c). In addition, Confidence defines special $-prefixed keys used to filter values for a given criteria.
Below is an example configuring a hapi server using a dynamic Confidence configuration.
constHapi=require('@hapi/hapi');constConfidence=require('@hapipal/confidence');conststore=newConfidence.Store({server: {host: 'localhost',port: {$param: 'PORT',$coerce: 'number',$default: 3000},debug: {$filter: 'NODE_ENV',$default: {log: ['error'],request: ['error']},production: {request: ['implementation']}}}});constconfig=store.get('/',process.env);constserver=Hapi.server(config);Confidence originated in the hapijs organization, and was adopted by hapi pal in April 2019.
