Advertisement
Jenderal92

Untitled

Jul 22nd, 2022
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. const mongoose = require('mongoose');
  2.  
  3. mongoose.Promise = global.Promise;
  4.  
  5. // Connecting to the database
  6. mongoose.connect("mongodb://localhost:31337/demodatabase")
  7. .then(() => {
  8. console.log("Connection successfully established");
  9. }).catch(err => {
  10. console.log('Could not connect to the database.');
  11. process.exit();
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement