Dont throw db error on dev
This commit is contained in:
parent
ed0b23f112
commit
a827c8fbb0
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue