First version

This commit is contained in:
Sebastien Castiel
2023-12-05 17:39:05 -05:00
parent 1fd6e48807
commit ed55c696cd
41 changed files with 8305 additions and 468 deletions

17
src/lib/prisma.ts Normal file
View File

@@ -0,0 +1,17 @@
import { PrismaClient } from '@prisma/client'
let prisma: PrismaClient
export function getPrisma() {
if (!prisma) {
if (process.env.NODE_ENV === 'production') {
prisma = new PrismaClient()
} else {
if (!(global as any).prisma) {
;(global as any).prisma = new PrismaClient()
}
prisma = (global as any).prisma
}
}
return prisma
}