0.0.5 • Published 5 years ago

pronto-documents-service v0.0.5

Weekly downloads
21
License
-
Repository
github
Last release
5 years ago

Documents Service

Interface for uploading files from a url or a local file path.

Configuration

Configure the service with a provider and the configuration for that provider's node api. For now just use s3.

provider: 's3'
s3: {
    accessKeyId: ''
    secretAccessKey: ''
    region: ''
}

If you wanted, you could spin up two separate documents services (with different slugs) that host images on separate providers... and use them to host bulk public & secure images from your platform in different places according to any requirements. You can also just do this with different s3 buckets from different apps.

Methods

uploadFileFromURL = (bucket, url, dest_filename, cb) ->

Upload to a bucket from a url. The file will be saved at s3:[bucket]/dest/filename/here.png

uploadFileFromPath = (bucket, path, dest_filename, cb) ->

Upload to a bucket from a local path on your server. The file will be saved at s3:[bucket]/dest/filename/here.png

deleteDocument = (bucket, full_filename, cb) ->

Remove a file from a bucket with an s3 path from that bucket.

0.0.5

5 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago