feat: started working with api

This commit is contained in:
2025-06-08 13:41:10 +03:00
parent 5948b9d739
commit 11c6d538b1
19 changed files with 299 additions and 31 deletions

11
src/utils/prisma.ts Normal file
View File

@@ -0,0 +1,11 @@
import { PrismaClient } from "@prisma/client";
const globalForPrisma = global as unknown as { prisma: PrismaClient };
export const prisma =
globalForPrisma.prisma ||
new PrismaClient({
log: ["query", "info", "warn", "error"],
});
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;