user managment
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user