discord-multipurpose-bot/dashboard/lib/mongodb.ts
2024-10-29 13:00:28 +00:00

10 lines
261 B
TypeScript

import { MongoClient } from "mongodb";
if (!process.env.MONGODB_URI) {
throw new Error("MongoDB URI not found in .env.local");
}
const client = new MongoClient(process.env.MONGODB_URI);
const clientPromise = client.connect();
export default clientPromise;