0.0.10 • Published 2 years ago

@coara/nestjs-aws-s3-manager v0.0.10

Weekly downloads
9
License
MIT
Repository
github
Last release
2 years ago

Nestjs aws s3 manager

File manager module for NestJs.

Installation

Yarn

yarn add @coara/nestjs-aws-s3-manager

NPM

npm install @coara/nestjs-aws-s3-manager --save

Getting Started

Let's register the FileManagerModule in app.module.ts

import { Module } from '@nestjs/common';
import { FileManagerModule } from '@coara/nestjs-aws-s3-manager';

@Module({
  imports: [
    FileManagerModule.forRoot({
      awsAccessKeyId: '****',
      awsSecretAccessKey: '****',
      awsBucketName: 'my-bucket-name',
    }),
  ],
})
export class AppModule {}

With Async

import { Module } from '@nestjs/common';
import { FileManagerModule } from '@coara/nestjs-aws-s3-manager';

@Module({
  imports: [
    FileManagerModule.forRootAsync({
      useFactory: (configService: ConfigService) => ({
        awsAccessKeyId: configService.get('AWS_ACCESS_KEY_ID'),
        awsSecretAccessKey: configService.get('AWS_SECRET_ACCESS_KEY'),
        awsBucketName: 'my-bucket-name',
      }),
      inject: [ConfigService],
    }),
  ],
})
export class AppModule {}

API Endpoints

curl -F 'file=@path/to/local/file' http://localhost:3000/images

That's it!

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago