An amazon s3 storage engine for librarian
npm install librarian-s3-storageNote: This version of librarian-s3-storage is compatible with librarian 2.0.0 and above.
```
$ npm install librarian-s3-storage
`js
var express = require('express')
var librarian = require('librarian')
var S3Storage = require('librarian-s3-storage')
var storage = new S3Storage({
bucket: 'my-cool-bucket',
prefix: 'uploads',
accessKeyId: AWS_ACCESS_KEY_ID,
secretAccessKey: AWS_SECRET_ACCESS_KEY
})
var app = express()
app.use('/files', librarian({
storage: storage
}))
app.listen(8888, function(){
console.log('app listening')
})
`
This is your Amazon S3 access key. Make sure that your key set has permission to access S3.
This is the bucket name that your files will be uploaded to.
If you want to store file uploads in a bucket along side other files, adding a prefix will allow you to put all your uploads in a "folder". For example, a prefix of uploads will allow you to also use the prefix assets, backups, and transfers for other things in the same project.
If true, this option will create the bucket if it does not already exist. Defaults to false`.