17 lines
389 B
TypeScript
17 lines
389 B
TypeScript
import { Client } from "minio";
|
|
|
|
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;
|
|
}
|