From a373e01356c47ba17e1aa82b3ea9b1b68166b58a Mon Sep 17 00:00:00 2001 From: DivyamAgg24 <142659327+DivyamAgg24@users.noreply.github.com> Date: Mon, 19 May 2025 22:00:21 +0530 Subject: [PATCH] updated_api --- apps/backend/ideas.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/backend/ideas.ts b/apps/backend/ideas.ts index 9ea66ec..316eaba 100644 --- a/apps/backend/ideas.ts +++ b/apps/backend/ideas.ts @@ -4,7 +4,9 @@ import prisma from "@repo/db/client"; import authMiddleware from "./middleware"; import { GoogleGenAI } from '@google/genai'; import {SystemPrompt} from "./constant" +import * as dotenv from 'dotenv'; +dotenv.config(); const router = express.Router(); // Schema validation for idea creation and updates @@ -109,7 +111,7 @@ router.post("/AIIdeaContent", authMiddleware, async (req: any, res: any) => { // Create Google Gemini AI instance const ai = new GoogleGenAI({ - apiKey: "AIzaSyAGXspPFiKkmicShhkyuGnUvqxuaWbBtKE", + apiKey: process.env.GEMINI_API_KEY , }); const config = {