@sebaseg/br-gcp-storage-crud
v1.3.2
Published
CRUD to get, download, save or update a document in gcp storage easily with nest.js
Downloads
29
Readme
BR GCP STORAGE CRUD NestJS Library
Nest.js library CRUD to get, download, save or update a document in gcp storage easily.
Instructions
Install
npm i @sebaseg/br-gcp-storage-crud
Use library
... STEP 1. You need to set the required storage credentials in your .env or secret managercredentials.
... STEP 2. import BrGcpStorageCrudModule in your module:
If you do not set names in root they will be taken as default:
import { Module } from '@nestjs/common';
import { YourService } from './your-service.service';
import { YourController } from './your-controller.controller';
import { BrGcpStorageCrudModule } from '@sebaseg/br-gcp-storage-crud';
@Module({
imports: [BrGcpStorageCrudModule.forRoot({})],
controllers: [YourController],
providers: [YourService],
})
export class YourModuleModule {}
If you use secretManager, you need to define the name. The default is ''
import { Module } from '@nestjs/common';
import { YourService } from './your-service.service';
import { YourController } from './your-controller.controller';
import { BrGcpStorageCrudModule } from '@sebaseg/br-gcp-storage-crud';
@Module({
imports: [
BrGcpStorageCrudModule.forRoot({ secretName: 'MY_SECRET_MANAGER_ENV_NAME' }),
],
controllers: [YourController],
providers: [YourService],
})
export class YourModuleModule {}
If you use .env you can define a name. The default name is STORAGE_CREDENTIALS
import { Module } from '@nestjs/common';
import { YourService } from './your-service.service';
import { YourController } from './your-controller.controller';
import { BrGcpStorageCrudModule } from '@sebaseg/br-gcp-storage-crud';
@Module({
imports: [
BrGcpStorageCrudModule.forRoot({
storageEnvCredName: 'YOUR_STORAGE_ENV_NAME',
}),
],
controllers: [YourController],
providers: [YourService],
})
export class YourModuleModule {}