mirror of
https://github.com/OwethuManagedServices/oms-website-nextjs.git
synced 2025-12-17 17:18:09 +00:00
create post completed
This commit is contained in:
11
lib/minio.ts
Normal file
11
lib/minio.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Client } from "minio";
|
||||
|
||||
export const minioClient = new Client({
|
||||
endPoint: process.env.MINIO_ENDPOINT || "localhost",
|
||||
port: process.env.MINIO_PORT ? parseInt(process.env.MINIO_PORT) : 9000,
|
||||
useSSL: true,
|
||||
accessKey: process.env.MINIO_ACCESS_KEY,
|
||||
secretKey: process.env.MINIO_SECRET_KEY,
|
||||
});
|
||||
|
||||
export const bucketName = process.env.MINIO_BUCKET || "oms-website";
|
||||
21
lib/prisma.ts
Normal file
21
lib/prisma.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user