Connect app to MySQL database at 192.168.4.20

This commit is contained in:
2025-12-01 18:45:48 +00:00
commit 0cfcd05921
16 changed files with 6302 additions and 0 deletions

9
lib/db.ts Normal file
View File

@@ -0,0 +1,9 @@
import { PrismaClient } from '@prisma/client'
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined
}
export const prisma = globalForPrisma.prisma ?? new PrismaClient()
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma