Something went wrong. Try again.
VueTube is a YouTube clone built with nodejs, expressjs & mongodb. This is the RESTful API repository.
Something went wrong. Try again.
485 B · 18 lines
JavaScript
at master
12345678910111213141516171819const mongoose = require('mongoose')
const DBconnection = async () => { const conn = await mongoose .connect(process.env.MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, useFindAndModify: false }) .catch(err => { console.log(`For some reasons we couldn't connect to the DB`.red, err) })
console.log(`MongoDB Connected: ${conn.connection.host}`.cyan.underline.bold)}
module.exports = DBconnection