1.0.2 • Published 7 years ago
parse-server-dropbox-adapter v1.0.2
Parse Server: Dropbox storage adapter
Notice
This is not maintained. The test-suite passed at the last commit, but no further work has been done to it and the CI has been stopped as the Dropbox test account was removed. Fork and use at your own risk.
Install
$ npm install --save parse-server-dropbox-adapter
Usage
filesAdapter: {
module: 'parse-server-dropbox-adapter',
options: {
token: 'dropbox oauth token',
prefix: '',
publicUrl: (prefix, name, join) =>
join('https://example.com/files/', `${prefix}${name}`)
}
}
Option | Default | Description |
---|---|---|
token | required | |
prefix | '' | A prefix to apply to all filenames. Can be set to e.g. '/foo/' to put all files in a subdirectory. A / will be prefixed if one isn't there already, unless the string is empty. |
publicUrl | required | A function that takes the prefix and a filename and returns a string for the public URL of the file, or false to disable public URLs. Third argument is url-join, a join -like function for URLs. |
Note that this module does not handle erasing files, so if you want to garbage-collect Parse files that are not being used, you need to do so yourself.
Test
You need a Dropbox token set as DROPBOX_TOKEN
in the environment to run
tests. It is recommended to set this to a dedicated "App Folder Only" token, so
the tests cannot access anything else and cannot mess up your Dropbox with its
temporary files. Also, app folders are not synced to your desktop by default,
so you'll be saving yourself from notifications and wasted bandwidth.