Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

fastify-rob-config

Fastify Rob-Config integration

Current Version Build Status

Install

npm i fastify-rob-config

Usage

First, initialize your configuration and schema file: https://github.com/jeromemacias/node-rob-config#rob-config

const fastify = require('fastify')()
const fastifyRobConfig = require('fastify-rob-config')

const config = require('rob-config')
const options = {
  confKey: 'config', // optional, default: config
  asProperties: false, // if true, you will access to config.key instead of config.get('key'), default: false
  config: config // optional, default: require('rob-config')
}

fastify.register(fastifyRobConfig, options, function (err) {
   // or fastify[options.confKey].get('env')
  console.log(fastify.config.get('env'))
}))

Credits

  • convict Featureful configuration management library for Node.js

About

Fastify Rob-Config integration

Resources

License

Packages

No packages published