This commit is contained in:
2025-12-03 16:40:46 +08:00
parent 31bc2a5576
commit 98f68fe300
6 changed files with 62 additions and 42 deletions

22
src/test/create-bucket.ts Normal file
View File

@@ -0,0 +1,22 @@
import { Client } from 'minio'
export async function createBucket(client: Client, bucketName: string) {
const exists = await client.bucketExists(bucketName)
if (!exists) {
await client.makeBucket(bucketName, '')
console.log(`Bucket "${bucketName}" created successfully.`)
} else {
console.log(`Bucket "${bucketName}" already exists.`)
}
}
const minioClient = new Client({
endPoint: 'minio.kevisual.cn',
port: 9000,
useSSL: false,
accessKey: 'admin',
secretKey: 'xiongxiao',
})
createBucket(minioClient, 'nocodb').catch((err) => {
console.error('Error creating bucket:', err)
})