create post completed

This commit is contained in:
libertyoms
2025-04-21 20:59:37 +02:00
parent 629da1b7e7
commit a8c6b5297b
21 changed files with 1973 additions and 37 deletions

21
lib/prisma.ts Normal file
View File

@ -0,0 +1,21 @@
import { PrismaClient } from "@prisma/client";
// PrismaClient is attached to the `global` object in development to prevent
// exhausting your database connection limit.
declare global {
// eslint-disable-next-line no-var
var prisma: PrismaClient | undefined;
}
export const prisma =
global.prisma ||
new PrismaClient({
log:
process.env.NODE_ENV === "development"
? ["query", "error", "warn"]
: ["error"],
});
if (process.env.NODE_ENV !== "production") {
global.prisma = prisma;
}