1.0.2 • Published 2 months ago

nestjs-qiniu v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

NestJs qiniu sdk

Description

A NestJS - qiniu, wrapping on qiniu

Installation

npm install nestjs-qiniu

Add it to the NestJS app.module.ts or any module

import { QiniuModule } from 'nestjs-qiniu';

@Module({
    imports: [
        QiniuModule.register({
            global: true,
            access_key: 'access_key',
            secret_key: 'secret_key',
            bucket: 'bucket',
            domain: 'http://bucket.test',
        }),
    ],
    controllers: [],
    providers: [],
})
export class Module {}

How to use

import { QiniuService } from "nestjs-qiniu";

@Injectable()
export class TestService{
    constructor(@Inject(QiniuService) private readonly qiniuService: QiniuService) {}
    
    public getQiniuConfig() {
        return this.qiniuService.options;
    }

    public updateQiniuConfig() {
        this.qiniuService.updateOptions({
            access_key: 'access_key',
            secret_key: 'secret_key',
            bucket: 'bucket',
            domain: 'http://bucket.test',
            // 
        });
    }
    
}
1.0.2

2 months ago

1.0.1

1 year ago

1.0.0

1 year ago