update minio endpoint

This commit is contained in:
2024-10-14 23:44:10 +07:00
parent 65b0462b01
commit ab8ae5d8d3
3 changed files with 6 additions and 3 deletions

View File

@@ -10,8 +10,7 @@ import { ConfigModule } from '@nestjs/config';
endPoint: process.env.MINIO_ENDPOINT ?? '10.0.27.1',
accessKey: process.env.MINIO_ACCESS_KEY ?? 'minioadmin',
secretKey: process.env.MINIO_SECRET_KEY ?? 'minioadmin',
useSSL: false,
port: 9000,
useSSL: true,
}),
],
providers: [MinioService],

View File

@@ -28,12 +28,14 @@ export class MinioService {
}
async getFileUrl(fileName: string, category: string) {
return await this.minioClient.presignedUrl(
const url = await this.minioClient.presignedUrl(
'GET',
this.configService.get('BUCKET_NAME') ?? 'epess',
`${category}/${fileName}`,
3600,
);
// replace the url with the url with actual url
return url;
}
async deleteFile(fileName: string) {