Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const mongoose = require('mongoose');
- mongoose.Promise = global.Promise;
- // Connecting to the database
- mongoose.connect("mongodb://localhost:31337/demodatabase")
- .then(() => {
- console.log("Connection successfully established");
- }).catch(err => {
- console.log('Could not connect to the database.');
- process.exit();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement