mongoose-attachments-aws
v1.0.1
Published
AWS S3 Storage Provider for mongoose-attachments
Downloads
15
Readme
mongoose-attachments-aws
AWS S3 Storage Provider for mongoose-attachments.
Installation
$ npm install mongoose-attachments-aws
Usage
The library will register automatically with mongoose-attachments
by performing require
and return a reference to the mongoose-attachments
plugin:
var attachments = require('mongoose-attachments-aws');
For further instructions check mongoose-attachments.
Configuration
Provider Name
aws
Options
region
: the s3 regionkey
: the s3 accessKeyIdsecret
: the s3 secretAccessKeybucket
: the s3 bucket in which to place the fileendpoint
: defaults to 'https://s3.amazonaws.com/'acl
: defaults to 'private'
For other configurations check mongoose-attachments.
var storage = {}
storage.providerName = 'aws'
storage.options = {
'region': '<region>',
'key' : '<key>',
'secret': '<secret>',
'bucket': '<bucket>',
'acl' : 'public-read'
}
require('mongoose-attachments-aws')
schema.plugin(require('mongoose-attachments'), {
directory: 'images',
storage: storage,
properties: buildProperties()
})
License (Apache 2.0)
Copyright (c) 2015 TWG - http://www.theworkinggroup.ca