first commit

This commit is contained in:
2024-05-16 16:05:41 +02:00
commit adf8283ae0
197 changed files with 26666 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
const MongoClient = require("mongodb").MongoClient;
const connectionString = "mongodb://db:27017";
const client = new MongoClient(connectionString);
let db;
const connectDb = async () => {
if (db) return db;
try {
const conn = await client.connect();
db = conn.db("jucundus");
return db;
} catch(e) {
console.error(e);
}
};
module.exports = connectDb;