Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. var config = require('./config.js');
  2.  
  3. var mongoose = require('mongoose');
  4. var db = mongoose.connection;
  5.  
  6. db.on('error', console.error.bind(console, 'connection error: '));
  7. db.once('open', function() {
  8. console.log('connection with database: ' + config.mongo.url + ' was successfully.');
  9. });
  10.  
  11. mongoose.connect(config.mongo.url);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement