[fix] Use the memory engine by default
This commit is contained in:
parent
badbb59e3f
commit
87351caac8
2 changed files with 9 additions and 3 deletions
|
@ -9,9 +9,14 @@ var Provider = require('./nconf/provider').Provider,
|
||||||
nconf = module.exports = Object.create(Provider.prototype);
|
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)
|
// ### function path (key)
|
||||||
|
|
|
@ -9,6 +9,7 @@ var stores = require('./stores');
|
||||||
|
|
||||||
var Provider = exports.Provider = function (options) {
|
var Provider = exports.Provider = function (options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
this.store = stores.create(options.type || 'memory', options);
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -20,7 +21,7 @@ var Provider = exports.Provider = function (options) {
|
||||||
//
|
//
|
||||||
Provider.prototype.use = function (type, options) {
|
Provider.prototype.use = function (type, options) {
|
||||||
if (!this.store || type.toLowerCase() !== this.store.type) {
|
if (!this.store || type.toLowerCase() !== this.store.type) {
|
||||||
this.store = new stores.create(type, options);
|
this.store = stores.create(type, options);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue