This commit is contained in:
2024-09-20 22:04:27 +08:00
parent e3991379df
commit a8f80abc88
15 changed files with 892 additions and 66 deletions

View File

@@ -1 +1,3 @@
export { sequelize } from './sequelize.ts';
export * from './minio.ts'

14
src/modules/minio.ts Normal file
View File

@@ -0,0 +1,14 @@
import { Client, ClientOptions } from 'minio';
import { useConfig } from '@abearxiong/use-config';
type MinioConfig = {
minio: ClientOptions & { bucketName: string };
};
const config = useConfig<MinioConfig>();
const { bucketName, ...minioRest } = config.minio;
export const minioClient = new Client(minioRest);
export { bucketName };
if (!minioClient) {
throw new Error('Minio client not initialized');
}