This is the repository of the Dropbox Booth Server. It's a NodeJS Server with Express and Socket.io. The server provide a REST API to communicate with Dropbox and send websocket messages for completed file uploads.
The Server works excellent with the ionic-booth app.
To get started, clone this repo, and run npm install
in the root directory. You need to configure the server now. Rename the example.env
to .env
and update the variables.
DROPBOX_TOKEN=dropboxtoken
PORT=5000
USERNAME=user
PASSWORD=pwd
After this run npm start
. This will start the server. You need to open your browser at http://localhost:5000/
and enter the username and password (e.g. user
, pwd
).
Open this Link Dropbox Token Generator and click "Get Token".
To upload files to a specific Dropbox folder you need to change the foldername in the ajax-call at client/index.html
.
Get all files of a Dropbox folder
/dropbox/:folder_path
You can see the full documentation from Dropbox here.
Get a temporary link of a Dropbox file
/dropbox/:folder_path/:file_name
To download a file directly from Dropbox you need a temporary link. You can see the full documentation from Dropbox here.
Post a image to a Dropbox folder
/dropbox/:folder_path
This will resize the image to max-width of 1920 pixel and rotate it to default orientation. After this will the upload starts. If this is completed, the server emit a websocket message image_uploaded
with some Dropbox upload information.
You can see the full documentation from Dropbox here.