This commit is contained in:
Ivan Rezchikov
2026-07-11 22:14:18 +03:00
parent 81576a0e37
commit ea852cd22f
2 changed files with 18 additions and 11 deletions
+14 -7
View File
@@ -1,9 +1,16 @@
import { Client } from "minio";
export const minioClient = new Client({
endPoint: process.env.MINIO_URL!,
port: Number(process.env.MINIO_PORT),
useSSL: false,
accessKey: process.env.MINIO_ACCESS_KEY!,
secretKey: process.env.MINIO_SECRET_KEY!
})
let _client: Client | null = null;
export function getMinioClient(): Client {
if (!_client) {
_client = new Client({
endPoint: process.env.MINIO_URL!,
port: Number(process.env.MINIO_PORT),
useSSL: false,
accessKey: process.env.MINIO_ACCESS_KEY!,
secretKey: process.env.MINIO_SECRET_KEY!
});
}
return _client;
}