Skip to content

Commit

Permalink
[fix] Use the memory engine by default
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed May 17, 2011
1 parent badbb59 commit 87351ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/nconf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ var Provider = require('./nconf/provider').Provider,
nconf = module.exports = Object.create(Provider.prototype);

//
// ### Version 0.1.7 :: 4/20/2011
// Use the memory engine by default.
//
nconf.version = [0, 1, 7];
nconf.use('memory');

//
// ### Version 0.1.9 :: 5/16/2011
//
nconf.version = [0, 1, 9];

//
// ### function path (key)
Expand Down
3 changes: 2 additions & 1 deletion lib/nconf/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var stores = require('./stores');

var Provider = exports.Provider = function (options) {
options = options || {};
this.store = stores.create(options.type || 'memory', options);
};

//
Expand All @@ -20,7 +21,7 @@ var Provider = exports.Provider = function (options) {
//
Provider.prototype.use = function (type, options) {
if (!this.store || type.toLowerCase() !== this.store.type) {
this.store = new stores.create(type, options);
this.store = stores.create(type, options);
}
};

Expand Down

0 comments on commit 87351ca

Please sign in to comment.