settings/db/connect.js

9 lines
234 B
JavaScript
Raw Normal View History

2024-07-30 11:26:42 +00:00
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