Skip to content

Instantly share code, notes, and snippets.

@dumbledork
Last active November 3, 2015 04:59
Show Gist options
  • Select an option

  • Save dumbledork/7ad12f0f8e0507795e5f to your computer and use it in GitHub Desktop.

Select an option

Save dumbledork/7ad12f0f8e0507795e5f to your computer and use it in GitHub Desktop.
var mongoose = require('mongoose');
mongoose.connection.on('open', function (ref) {
console.log('Connected to mongo server.');
});
mongoose.connection.on('error', function (err) {
console.log('Could not connect to mongo server!');
console.log(err);
});
mongoose.connect('mongodb://192.168.21.159:27017/mongodb');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment