Skip to content

Commit

Permalink
fix: export
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Dec 23, 2022
1 parent abaed02 commit 938a0a8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ import { NestMinioModule } from '../nest-minio.module';
@Module({
controllers: [NestMinioClientController],
imports: [
NestMinioModule.register({
NestMinioModule.register(
isGlobal: true,
{
endPoint: 'play.min.io',
port: 9000,
useSSL: true,
Expand All @@ -67,7 +69,6 @@ import { NestMinioModule } from '../nest-minio.module';
})
export class NestMinioClientModule {}

});
```
Then you can use it in the controller or service by injecting it in the controller as:

Expand All @@ -86,12 +87,16 @@ We will use the MinIO server running at https://play.min.io in this example. Fee

import { Controller, Get, Inject } from '@nestjs/common';
import { MINIO_CONNECTION } from '../constants';
import {Client} from 'minio';
import {Client, InjectMinio} from 'minio';

@Controller()
export class NestMinioClientController {
// use inject token
constructor(@Inject(MINIO_CONNECTION) private readonly minioClient: Client) {}

// or use inject decorator
// constructor(@InjectMinio() private readonly minioClient: Client) {}

@Get()
index() {
const file = '/tmp/app.zip';
Expand Down

0 comments on commit 938a0a8

Please sign in to comment.