0.0.7 • Published 1 year ago

parse2use v0.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

parse-server-ftp-http-adapter

codecov.io

Build Status

parse-server file adapter for FTP upload and HTTP download

Installation

npm install --save parse-server-ftp-http-adapter

AWS DynamoDB

pip install awscli                    // install awscli using python pip
aws configure set region eu-central-1 // set your aws region
aws configure                         // set your AWS Access Key ID and Secret
aws dynamodb create-table 
    --table-name parse-server 
    --attribute-definitions AttributeName=_pk_className,AttributeType=S AttributeName=_sk_id,AttributeType=S
    --key-schema AttributeName=_pk_className,KeyType=HASH AttributeName=_sk_id,KeyType=RANGE 
    --provisioned-throughput ReadCapacityUnits=500,WriteCapacityUnits=1000

Usage

...
var FtpHttpAdapter = require('parse-server-ftp-http-adapter');

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  appId:       process.env.APP_ID || 'APPLICATION_ID',
  masterKey:   process.env.MASTER_KEY || 'MASTER_KEY',
  ...
  filesAdapter: new FtpHttpAdapter({
    ftp: {
      host:     "example.com",         # required
      port:     21,                    # defaults to 21
      username: "user",                # defaults to "anonymous"
      password: "secret",              # defaults to "anonymous@"
      path:     "/example.com/uploads" # defaults to "/"
      ...                              # any other options to send to node-ftp
    },
    http: {
      host: "http://example.com",      # required
      port: 80,                        # defaults to 80
      path: "/uploads"                 # defaults to "/"
    },
    debug: true                        # defaults to false
  }),
  ...
});