Skip to content

OzgeAkin/parse-server-s3-adapter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-server-s3-adapter

codecov.io Build Status

parse-server adapter for AWS S3

installation

npm install --save parse-server-s3-adapter

usage with parse-server

using a config file

{
  "appId": 'my_app_id',
  "masterKey": 'my_master_key',
  // other options
  "filesAdapter": {
    "module": "parse-server-s3-adapter",
    "options": {
      "accessKey": "accessKey",
      "secretKey": "secretKey",
      "bucket": "my_bucket",
      // optional:
      "region": 'us-east-1', // default value
      "bucketPrefix": '', // default value
      "directAccess": false, // default value
      "baseUrl": null // default value
    }
  }
}

using environment variables

Set your environment variables:

S3_ACCESS_KEY=accessKey
S3_SECRET_KEY=secretKey
S3_BUCKET=bucketName

And update your config / options

{
  "appId": 'my_app_id',
  "masterKey": 'my_master_key',
  // other options
  "filesAdapter": "parse-server-s3-adapter"
}

passing as an instance

var S3Adapter = require('parse-server-s3-adapter');

var s3Adapter = new S3Adapter('accessKey',
                  'secretKey',
                  'bucket' , {
                    region: 'us-east-1'
                    bucketPrefix: '',
                    directAccess: false,
                    baseUrl: 'http://images.example.com'
                  });

var api = new ParseServer({
	appId: 'my_app',
	masterKey: 'master_key',
	filesAdapter: s3adapter
})

or with an options hash

var S3Adapter = require('parse-server-s3-adapter');

var s3Options = {
  "accessKey": "accessKey",
  "secretKey": "secretKey",
  "bucket": "my_bucket",
  // optional:
  "region": 'us-east-1', // default value
  "bucketPrefix": '', // default value
  "directAccess": false, // default value
  "baseUrl": null // default value
}

var s3Adapter = new S3Adapter(s3Options);

var api = new ParseServer({
  appId: 'my_app',
  masterKey: 'master_key',
  filesAdapter: s3Adapter
})

About

AWS S3 adapter for parse-server

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%