From 479b6584164ad7c267337824cbdfa6e9be9396ca Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 15 Oct 2024 22:47:19 +0530 Subject: [PATCH] feat: check if minio connected --- server/src/storage/mino.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/src/storage/mino.ts b/server/src/storage/mino.ts index 1803e027..ce1a63b0 100644 --- a/server/src/storage/mino.ts +++ b/server/src/storage/mino.ts @@ -9,6 +9,18 @@ const minioClient = new Client({ secretKey: process.env.MINIO_SECRET_KEY || 'minio-secret-key', }); +minioClient.bucketExists('maxun-test') + .then((exists) => { + if (exists) { + console.log('MinIO was connected successfully.'); + } else { + console.log('Bucket does not exist, but MinIO was connected.'); + } + }) + .catch((err) => { + console.error('Error connecting to MinIO:', err); + }) + class BinaryOutputService { private bucketName: string;