Created
September 12, 2016 15:57
-
-
Save unicodeveloper/77bab7de0461a701e5f7b8006be111cc to your computer and use it in GitHub Desktop.
Cloudinary Blog post - Part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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