settings/db/connect.js

9 lines
234 B
JavaScript

const mongoose = require('mongoose')
const connectDB = async () => {
await mongoose.connect(process.env.DB_MONGO_URL, { dbName: process.env.DB_MONGO_NAME })
}
connectDB().catch((err) => console.log(err))
module.exports = mongoose