From 4182918b31d87c60886b2c0ea3b51b1b6b20170f Mon Sep 17 00:00:00 2001 From: Austin Bennett Date: Fri, 9 May 2025 11:27:05 -0500 Subject: [PATCH] removed an env variable --- src/pages/api/subscribe.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/api/subscribe.ts b/src/pages/api/subscribe.ts index 73cfeb9..48a2a94 100644 --- a/src/pages/api/subscribe.ts +++ b/src/pages/api/subscribe.ts @@ -3,8 +3,6 @@ import { NextApiRequest, NextApiResponse } from 'next'; export const runtime = 'edge'; const MONGODB_URI = process.env.MONGODB_URI as string; // Add this in your .env.local file -const MONGODB_DB = process.env.MONGODB_DB as string; // Add this in your .env.local file - // Create a MongoClient instance let cachedClient: MongoClient | null = null; @@ -13,7 +11,7 @@ async function connectToDatabase() { cachedClient = new MongoClient(MONGODB_URI); await cachedClient.connect(); } - return cachedClient.db(MONGODB_DB); + return cachedClient.db(MONGODB_URI); } export default async function handler(req: NextApiRequest, res: NextApiResponse) {