Skip to content

Commit

Permalink
Allow setting S3 endpoint. (#23)
Browse files Browse the repository at this point in the history
* Allow setting S3 endpoint.

* Note endpoint option in docs.
  • Loading branch information
andrewsomething authored and DanielHindi committed Mar 5, 2018
1 parent f0e1334 commit ddfec3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ Either from the constructor or from the `init(config)` function you can pass alo
accessKeyId: [Your access id],
secretAccessKey: [your access key],
region: [the region of your S3 bucket],
bucket: [your bucket name]
bucket: [your bucket name],
endpoint: [optional, for use with S3-compatible services]
}
```

Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ S3Zipper.prototype = {
});
}

if (awsConfig.endpoint) {
AWS.config.update({
endpoint: awsConfig.endpoint
});
}

self.s3bucket = new AWS.S3({
params: {
Bucket: self.awsConfig.bucket
Expand Down

0 comments on commit ddfec3f

Please sign in to comment.