@@ -0,0 +1,683 @@
+var mongo = require('mongoskin');%0Avar db = %7B%7D;%0A%0Aif(!conf.db.database) %7B%0A%09throw new Error(%22No DB defined. Exitting....%22);%0A%09process.exit();%0A%7D%0A%0Aif(conf.db.username && conf.db.password) %7B%0A%09db = mongo.db('mongo://'+conf.db.username+':'+conf.db.password+'@'+conf.db.host+':'+conf.db.port+'/'+conf.db.database, %7B'auto_reconnect': true , 'poolSize': 1 , w:1 , safe: true%7D);%0A%7D else %7B%0A%09db = mongo.db('mongo://'+conf.db.host+':'+conf.db.port+'/'+conf.db.database, %7B'auto_reconnect': true , 'poolSize': 1 , w:1 , safe: true%7D);%0A%7D%0Adb.open(function(err, data) %7B%0A%09if(err) %7B%0A%09%09throw new Error(err);%0A%09%7D%0A%7D);%0Adb.on('error', function(err) %7B%0A%09if(err) %7B%0A%09%09throw new Error(err);%0A%09%7D%0A%7D);%0A%0Amodule.exports = db;

update /lib/db