Created
July 6, 2018 08:10
-
-
Save rikkrome/8997e3ba0f948c5bc0ddcc227ff77f3c to your computer and use it in GitHub Desktop.
mongoose connect
This file contains hidden or 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
// DB Config | |
const db = require('./config/keys').mongoURI; | |
// connect to mongoDB | |
mongoose | |
.connect(db) | |
.then(() => { | |
console.log('MongoDB Connected'); | |
}) | |
.catch(err => { | |
console.log(err); | |
console.log('MongoDB Not Connected'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment