Rust discount function (one automatic discount evaluating all offers in priority order, parity with the Odoo engine), React Router admin with Polaris, theme app extension and app proxy pages, webhooks incl. GDPR, managed-pricing limits, and a Docker Compose stack (Postgres + Caddy HTTPS) for a single VPS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
349 B
TypeScript
17 lines
349 B
TypeScript
import { PrismaClient } from "@prisma/client";
|
|
|
|
declare global {
|
|
// eslint-disable-next-line no-var
|
|
var prismaGlobal: PrismaClient;
|
|
}
|
|
|
|
if (process.env.NODE_ENV !== "production") {
|
|
if (!global.prismaGlobal) {
|
|
global.prismaGlobal = new PrismaClient();
|
|
}
|
|
}
|
|
|
|
const prisma = global.prismaGlobal ?? new PrismaClient();
|
|
|
|
export default prisma;
|