add lib
This commit is contained in:
1 parent
d80baa43b7
commit
654f95ac6f
4 files changed
+180
-1
No files matched your search
@@ -0,0 +1,14 @@
|
||||
const { MongoClient } = require("mongodb");
|
||||
require("dotenv").config();
|
||||
|
||||
let client, db;
|
||||
|
||||
exports.getDb = async function () {
|
||||
if (db) return db;
|
||||
|
||||
client = new MongoClient(process.env.MONGO_URI);
|
||||
await client.connect();
|
||||
|
||||
db = client.db("downloads");
|
||||
return db;
|
||||
};
|
||||
Reference in new issue
Block a user