18 lines
314 B
JavaScript
18 lines
314 B
JavaScript
|
const { MongoClient } = require('mongodb')
|
||
|
|
||
|
const uri = process.env.DB_MONGO_URL
|
||
|
|
||
|
const mongo = new MongoClient(uri)
|
||
|
|
||
|
async function run() {
|
||
|
try {
|
||
|
await mongo.connect()
|
||
|
console.log('Connectado ao mongo db')
|
||
|
} catch (err) {
|
||
|
console.log(err)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
run()
|
||
|
|
||
|
module.exports = mongo
|