From 503e8e34dd6471a6a0639fd4848119482ca1db45 Mon Sep 17 00:00:00 2001 From: Aelita4 Date: Mon, 23 Sep 2024 13:05:11 +0200 Subject: [PATCH] Add support for connecting to MongoDB Atlas --- .gitignore | 1 + src/lib/db/mongodb.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b838eed..53e297f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ pnpm-debug.log* .env .env.production config.json +certs/ # macOS-specific files .DS_Store diff --git a/src/lib/db/mongodb.ts b/src/lib/db/mongodb.ts index 153ef43..bd5449c 100644 --- a/src/lib/db/mongodb.ts +++ b/src/lib/db/mongodb.ts @@ -2,7 +2,9 @@ import { MongoClient } from "mongodb"; import config from '../../../config.json' const uri = config.MONGODB_URI; -const options = {}; +const options = { + tlsCertificateKeyFile: config.MONGODB_CERT +}; const mongo = new MongoClient(uri, options);