Saturday, 10 March 2012

node.js boilerplate - cascading configuration files using konphyg

konphyg is a very simple configuration manager. It allows you to configure environment based configuration files by naming the config files like so.

express.json
express.test.json
express.production.json

The config files are setup as raw JSON files, with a .json extension:



By default konphyg will pickup; in this case; express.json.

In order to set this up simply reguire the config folder and read the file. Setting the NODE_ENV variable to the relevant eneironment controls which config file is picked up.



References
https://github.com/pgte/konphyg

About
This post is part of a series of posts tagged under node-plates a boilerplate mobile/web application written in node.js, express, socket.io, mongooose, jquery.mobile & html 5.

Github
You can grab this from github ->
https://github.com/AndrewKeig/node-plates

No comments:

Post a Comment