Skip to content

Instantly share code, notes, and snippets.

@unicodeveloper
Created September 12, 2016 15:57
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 unicodeveloper/77bab7de0461a701e5f7b8006be111cc to your computer and use it in GitHub Desktop.
Save unicodeveloper/77bab7de0461a701e5f7b8006be111cc to your computer and use it in GitHub Desktop.
Cloudinary Blog post - Part 1
var mongoose = require('mongoose'),
secrets = require('./secrets');
var db = mongoose.connection;
mongoose.connect(secrets.db);
module.exports = {
dbconnect: function(){
db.on('error', console.error.bind( console, 'MongoDB Connection Error. Please make sure that MongoDB is running.'));
db.once('open', function callback(){
console.log('Yourtube db opened');
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment