Skip to content

How to add configuration settings

Cristian Douce edited this page Oct 31, 2013 · 6 revisions

Follow this checklist whenever you need a new config value so the rest of us can continue coding happily with your changes.

  1. Add the configuration key to config/sample.json
  2. If the setting is intended to be shared with the client, then list it at client key on the same file.
  3. Edit lib/config/env.js to map the recently added keys. (Note: Environment variables name should be the same as the config variable name but in ALL_CAPS. Follow the examples in that file.)
  4. Restart your app to get new config keys merged to your config/<environment>.json settings. (Note: client settings won't be merged)
  5. If needed, edit your config/<environment>.json file used or your environment settings for custom environment settings (non-default).
  6. If new client settings added (check 2.) make sure your co-developers know they have to manually add those to their config/<environment>.json settings.
  7. Add those values to env vars at your running environments so your new code works.

DemocracyOS developers should update all of these.