Skip to content

Commit

Permalink
node 0.6.x compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
gzbigegg committed Feb 10, 2012
1 parent 9db1749 commit 72bafd4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
10 changes: 4 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,17 @@ exports.boot = function (next,cluster) {

// Load configuration
var Config = require(path + "/lib/Config").Config;
app.config = new Config({},function(err) {

// TODO : Check for error
app.config = new Config();
app.config.init();
console.log("App Config is " + app.config);

// Load application configuration
theme = app.config.get('themes:front');
// theme = app.config.get('themes:front');
// Bootstrap application
bootApplication(function () {
next(app);
});

});

};

// allow normal node loading if appropriate
Expand Down
13 changes: 7 additions & 6 deletions lib/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var rootpath = process.cwd() + '/',
* @type
* @options
*/
function Config(options,next) {
function Config(options) {

// Defaults
this.type = options && options.type ? options.type : 'file';
Expand All @@ -24,12 +24,13 @@ function Config(options,next) {
// Default to file based on environment
this.options = options && options.options ? options.options : { file: this.file };

// Initialise
this.nconf = require('nconf');
this.load(function(err) {
next(err);
});
}

Config.prototype.init = function() {
this.nconf = require('nconf');
this.load(function(err) {
console.log(err);
});
}

/**
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,38 @@
"tests": "./tests"
},
"engines": {
"node": "0.4.x || 0.5.x"
"node": "0.6.x"
},
"dependencies": {
"express": "2.4.x",
"connect": "1.6.x",
"ejs": "0.4.x",
"jade": "0.13.x",
"stylus": "0.13.x",
"underscore":"1.1.x",
"mongoose": "2.0.x",
"winston": "0.3.x",
"express": "2.5.x",
"connect": "1.8.x",
"ejs": "0.6.x",
"jade": "0.20.x",
"stylus": "0.23.x",
"underscore":"1.3.x",
"mongoose": "2.5.x",
"winston": "0.5.x",
"mongodb": "0.9.x",
"connect-form": "0.2.x",
"qs": "0.3.x",
"request":"2.0.1",
"qs": "0.4.x",
"request":"2.9.x",
"pool":"0.4.x",
"mime":"1.2.x",
"cluster": "0.6.x",
"cluster": "0.7.x",
"step": "0.0.x",
"optimist":"0.2.x",
"colors":"0.5.x",
"bcrypt": "0.2.x",
"optimist":"0.3.x",
"colors":"0.6.x",
"bcrypt": "0.5.x",
"semver":"1.0.x",
"hook.io":"0.7.x",
"zipfile":"0.2.x",
"rimraf":"1.0.x",
"nconf":"0.2.x",
"hook.io":"0.8.x",
"zipfile":"0.3.x",
"rimraf":"2.0.x",
"nconf":"0.5.x",
"async": "0.1.x"
},
"devDependencies": {
"expresso": "0.8.x",
"should": "0.2.x"
"expresso": "*",
"should": "*"
},
"scripts": {
"install" : "bash ./bin/install.sh",
Expand Down

0 comments on commit 72bafd4

Please sign in to comment.