Skip to content

Instantly share code, notes, and snippets.

@alanhoff
Created May 31, 2014 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanhoff/8aba5a9848f74f8b6e1c to your computer and use it in GitHub Desktop.
Save alanhoff/8aba5a9848f74f8b6e1c to your computer and use it in GitHub Desktop.
var mongodb = require('mongodb');
var config = require(__dirname + '/../config/general.json');
var db = null;
mongodb.MongoClient.connect(config.mongodb, function(err, database) {
if(err)
throw err;
db = database;
process.emit('dbready');
});
module.exports = db;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment