DemocracyOS / config

Node configuration json files loader. Overrideable by environment variables. Very opinionated.
MIT License
6 stars 1 forks source link

Add optional empty object #5

Closed franciclo closed 8 years ago

franciclo commented 8 years ago

closes #4

mjlescano commented 8 years ago

@gvilarino What do you think about this?

This option is to allow to use objects with any amount of key/values inside. Bassically it allows to set JSON options.

It's useful when we want to have 100% flexibility on the configuration, e.g. hiper custom settings for nodemailer. If we want to allow to use a custom SMTP server, we should add all of this options to our defaults.json, and probably, mantain them updated.

With this, we can simply add this to our defaults.json:

{
  "notifications" : {
    "nodemailer": {}
  }
}

and be able to configure it via jason adding key/value pairs to "nodemailer" or by environment variable using JSON: NOTIFICATIONS_NODEMAILER='{"secure": true, "requireTLS": true}'