Skip to content

Commit

Permalink
fix: minio connection export
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Dec 22, 2022
1 parent 590b07a commit 0f80e26
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/nest-minio.connection.providers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { NestMinioService } from './nest-minio.service';

export const MINIO_CONNECTION = 'MINIO_CONNECTION';

export const connectionFactory = {
provide: MINIO_CONNECTION,
useFactory: async (nestMinioService) => {
return nestMinioService.getMinio();
},
inject: [NestMinioService],
};
5 changes: 3 additions & 2 deletions src/nest-minio.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import { Module } from '@nestjs/common';
import { NestMinioService } from './nest-minio.service';
import { ConfigurableModuleClass } from './nest-minio.module-definition';
import { connectionFactory } from './nest-minio.connection.providers';

@Module({
providers: [NestMinioService],
exports: [NestMinioService],
providers: [NestMinioService,connectionFactory],
exports: [NestMinioService,connectionFactory],
})
export class NestMinioModule extends ConfigurableModuleClass {}

0 comments on commit 0f80e26

Please sign in to comment.