mongoose-attachments-aws

1.0.1 • Public • Published

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 region
  • key: the s3 accessKeyId
  • secret: the s3 secretAccessKey
  • bucket: the s3 bucket in which to place the file
  • endpoint: 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

Package Sidebar

Install

npm i mongoose-attachments-aws

Weekly Downloads

5

Version

1.0.1

License

Apache-2.0

Last publish

Collaborators

  • krisk