You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paste/db.js

13 lines
311 B
JavaScript

const mongoose = require('mongoose');
const config = require('config');
mongoose.connection.on('error', console.error.bind(console, 'MongoDB connection error:'));
mongoose.connect(config.db, {
useCreateIndex: true,
useNewUrlParser: true,
useUnifiedTopology: true
});
module.exports = mongoose.connection;