@rexfng/s3upload
v1.8.0
Published
module to generate pre-signed url for s3 upload
Downloads
14
Readme
Description
module to generate pre-signed url for s3 upload
Initialize
- define enviornment variable AWS_ACCESS_KEY and AWS_SECRET_KEY
const s3upload = require('@rexfng/s3upload').routes
Router Methods
//returns routes which can be used with express ex.
const express = require('express')
app = express();
app.listen(3000);
const s3upload = require('@rexfng/s3upload')
app.use('/', s3upload.routes.read)
app.use('/', s3upload.routes.update) // also use for creating
app.use('/', s3upload.routes.delete)
// POST to "/" with body JSON
let options = {
'ttl', //in seconds
'bucket',
'filename',
'filetype',
'acl': "public-read", // "public-read" , "private"
}
// DELETE to "/" with body JSON
let options = {
'bucket',
'filename'
}