Giter Site home page Giter Site logo

node-config's Introduction

node-config

Configuration control for production node deployments

Introduction

Node-config is a configuration system for Node.js application server deployments. It lets you define a default set of application parameters, and tune them for different runtime environments (development, qa, staging, production, etc.).

Parameters defined by node-config can be monitored and tuned at runtime without bouncing your production servers.

Online documentation is available at http://lorenwest.github.com/node-config/latest

Quick Start

In your project directory, install and verify using npm:

my-project$ npm install config
my-project$ npm test config

Edit the default configuration file (.js, .json, or .yaml):

my-project$ mkdir config 
my-project$ vi config/default.yaml

(example default.yaml file):

Customer:
  dbHost: localhost
  dbPort: 5984
  dbName: customers

Edit the production configuration file:

my-project$ vi config/production.yaml

(example production.yaml file):

Customer:
  dbHost: prod-db-server

Use the configuration in your code:

var CONFIG = require('config').Customer;
...
db.connect(CONFIG.dbHost, CONFIG.dbPort, CONFIG.dbName);

Start your application server:

my-project$ export NODE_ENV=production
my-project$ node app.js

Running in this configuration, CONFIG.dbPort and CONFIG.dbName will come from the default.yaml file, and CONFIG.dbHost will come from the production.yaml file.

See Also

node-config - Online documentation
node-monitor - Monitor your running node applications

License

Released under the Apache License 2.0

See LICENSE file.

Copyright (c) 2011 Loren West

node-config's People

Contributors

lorenwest avatar abh avatar dmajrekar avatar hisayan avatar

Stargazers

Emilis Dambauskas avatar

Watchers

Emilis Dambauskas avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.