s3-proxy-stream
Simplified s3.getObject()
designed for proxying.
API
const get = require('s3-proxy-stream')(s3, options)
const s3 = // access keys and stuff params: Bucket: 'my-bucket' // whichever bucket you are using const get = s3 // default `s3.getObject()` params // you can also set `Bucket` here Bucket: 'my-bucket'
All options
are defaults for every request.
get(key, [options]).then(stream => {}).catch(err => {})
Get an object at key
.
options
is passed to s3.getObject()
, except we have an extra field called .headers
.
Simply pass request.headers
and the appropriate s3.getObject()
params will be set.
app
stream
The stream has the following properties:
.status
and.statusCode
- the status code of the response.headers
- headers of the response
error
The error has the following properties:
.status
and.statusCode
- the status code of the response