11 lines
323 B
JavaScript
11 lines
323 B
JavaScript
|
const mongoose = require('mongoose')
|
||
|
require('dotenv').config({ path: `${process.cwd()}/.env` })
|
||
|
|
||
|
async function main(){
|
||
|
await mongoose.connect(process.env.DB_MONGO_URL, { dbName: process.env.DB_MONGO_NAME })
|
||
|
console.log('Conectou ao Mongoose!')
|
||
|
}
|
||
|
|
||
|
main().catch((err)=>console.log(err))
|
||
|
|
||
|
module.exports = mongoose
|