Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Add support for configurable S3 constructor options
Browse files Browse the repository at this point in the history
Closes #9
  • Loading branch information
robertrossmann committed Jun 21, 2016
1 parent 6a77e62 commit 6b14554
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ You upload the files as usual with any other adapter. See some examples below.
| region | String | Optional. If your S3 bucket resides in a different region than "us-standard", you can use this parameter to operate on that region. |
| s3params | Object | Optional parameters to be passed to the underlying Amazon SDK library when performing the file upload. This could be any parameter that is supported by the S3's [`upload()`][s3-upload] method. |
| s3options | Object | Optional configuration for the upload request to be passed to the underlying Amazon SDK library. This could be any parameter that is supported by the second argument of the [`upload()`][s3-upload] method. |
| s3config | Object | Optional configuration for the S3 service itself. This is passed directly to the [`constructor`][s3-constructor].
| onProgress | Function | Marked by Skipper core as experimental. If provided, will be called periodically as the data is being uploaded with current progress information. |

#### Example usage
Expand Down Expand Up @@ -212,4 +213,5 @@ This software is licensed under the **BSD-3-Clause License**. See the [LICENSE](
[skipper-logo]: http://i.imgur.com/P6gptnI.png
[project-root]: https://github.com/Dreamscapes/skipper-better-s3
[s3-upload]: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property
[s3-constructor]: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#constructor-property
[s3-presigned-urls]: http://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html
4 changes: 4 additions & 0 deletions lib/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ module.exports = class Adapter {
.excluding('s3options')
.into({})

config.service = merge(config.service)
.and(opts.s3config || {})
.into({})

return config
}

Expand Down

0 comments on commit 6b14554

Please sign in to comment.