Dont throw db error on dev

This commit is contained in:
I-Have-An-Issue 2022-10-21 18:00:36 -04:00
parent ed0b23f112
commit a827c8fbb0
No known key found for this signature in database
GPG Key ID: E55435DEA0825091
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import { prerendering } from "$app/environment";
import { randomBytes, randomUUID } from "crypto";
import { INVITE_KEY_PREFIX, SESSION_EXPIRE } from "$lib/constants";
if (!process.env.MONGO_URL) throw new Error("Missing MONGO_URL env variable!");
if (process.env.PRODUCTION && !process.env.MONGO_URL) throw new Error("Missing MONGO_URL env variable!");
const client = new MongoClient(process.env.MONGO_URL);
if (!prerendering) await client.connect();