Skip to content

Instantly share code, notes, and snippets.

@nomanHasan
Last active September 7, 2017 19:00
Show Gist options
  • Save nomanHasan/dda5a5af80bce7d9e183cb8a7ed9827f to your computer and use it in GitHub Desktop.
Save nomanHasan/dda5a5af80bce7d9e183cb8a7ed9827f to your computer and use it in GitHub Desktop.
Add Mongoose Connection
var mongoose = require('mongoose')
mongoose.connect('mongodb://127.0.0.1:27017/todoapp', { useMongoClient: true})
.then(()=> { console.log(`Succesfully Connected to the Mongodb Database at URL : mongodb://127.0.0.1:27017/todoapp`)})
.catch(()=> { console.log(`Error Connecting to the Mongodb Database at URL : mongodb://127.0.0.1:27017/todoapp`)})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment