'use strict';
var mongoose = require('mongoose');

module.exports = function(config){
	mongoose.connect(config.db);
	
	var db = mongoose.connection;
	db.on('error', console.error.bind(console, 'connection error:'));
	db.once('open', function (){
		console.log('Connected to database: ' + config.db);
	});
};
'use strict';
var mongoose = require('mongoose');

module.exports = function(config){
	mongoose.connect(config.db);
	
	var db = mongoose.connection;
	db.on('error', console.error.bind(console, 'connection error:'));
	
};
add database connection and configuration to mongodb