user managment

This commit is contained in:
2024-06-24 18:37:04 +02:00
parent bafef0f6b3
commit 0c7fc6fdf7
50 changed files with 2748 additions and 219 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
const MongoClient = require("mongodb").MongoClient;
const connectionString = "mongodb://db:27017";
const config = require("../config.js");
const connectionString = config.db.connectionString;
const client = new MongoClient(connectionString);
let db;
@@ -8,7 +9,7 @@ const connectDb = async () => {
if (db) return db;
try {
const conn = await client.connect();
db = conn.db("jucundus");
db = conn.db(config.db.dbName);
return db;
} catch(e) {
console.error(e);