From 0ca7c01bc4a6c5ab50ac80f9a8e5d5c5db442f45 Mon Sep 17 00:00:00 2001 From: Rory& Date: Sun, 1 Jun 2025 08:04:30 +0200 Subject: Register works, part of login and auth middleware --- src/db/db.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/db/db.js') diff --git a/src/db/db.js b/src/db/db.js index b9a425c..2035731 100644 --- a/src/db/db.js +++ b/src/db/db.js @@ -1,11 +1,14 @@ -import { connect } from 'mongoose'; +import mongoose, { connect } from 'mongoose'; import { readSecret } from '#util/secretUtils.js'; export async function initDb() { const connectionString = await readSecret( - "MongoDB connection string", + 'MongoDB connection string', process.env['DATABASE_SECRET_PATH'] ); + + if (process.env['LOG_QUERIES']) mongoose.set('debug', true); + try { const res = await connect(connectionString); if (res.connection.readyState === 1) { -- cgit 1.5.1