Skip to content

Commit

Permalink
feat(s3options and configloader): support digitalocean spaces
Browse files Browse the repository at this point in the history
Since digital ocean spaces uses aws sdk and api itself, exposing just the endpoint property so we
can use as the remote
  • Loading branch information
dineshsalunke committed May 27, 2020
1 parent c410486 commit 09adacb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/interfaces/multer-extended-s3-options.interface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { LoggerService } from '@nestjs/common';

export interface MulterExtendedS3Options {
/*
* AWS Endpoint
*/
readonly endpoint?: string;
/**
* AWS Access Key ID
*/
Expand Down
4 changes: 3 additions & 1 deletion lib/multer-config.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export class MulterConfigLoader implements MulterS3ConfigService {
region: s3Options.region || MulterConfigLoader.DEFAULT_REGION,
});

this.S3 = new AWS.S3();
this.S3 = new AWS.S3({
endpoint: s3Options.endpoint,
});
this.logger = s3Options.logger || new Logger(MulterConfigLoader.name);
this.logger.log(JSON.stringify(s3Options));
}
Expand Down

0 comments on commit 09adacb

Please # to comment.