Upload any file, get a URL back.
python setup.py install
## Run the app
python run.py
or using gunicorn:
gunicorn guacamole:app
### Post a file
POST /files/
Parameter | Type | Required |
---|
file | file | yes
tags | string | no
curl -F "file=@tests/fixtures/image.jpg" -F "tags=Mexican, food" 127.0.0.1:5000/files/
{
"upload_date": 1448922069,
"hash": [
"80e0ad2f295b80a4b248b2bb286368243e60d610"
],
"name": "image.jpg",
"tags": [
"mexican",
"food"
],
"uri": "QVbB/OU2s/1atb/XtWn/8kwm/sT2w/image.jpg",
"mime_type": "image/jpeg",
"size": 39092
}
### Get a file
GET /files/{uri}
Parameter | Type | Required |
---|
uri | string | yes
curl 127.0.0.1:5000/files/QVbB/OU2s/1atb/XtWn/8kwm/sT2w/image.jpg
### Get a file's metadata
GET /files/{uri}/meta
parameter|type|required uri|string|yes
curl 127.0.0.1:5000/files/QVbB/OU2s/1atb/XtWn/8kwm/sT2w/image.jpg/meta
{
"upload_date": 1448922069,
"hash": [
"80e0ad2f295b80a4b248b2bb286368243e60d610"
],
"name": "image.jpg",
"tags": [
"mexican",
"food"
],
"uri": "QVbB/OU2s/1atb/XtWn/8kwm/sT2w/image.jpg",
"_id": {
"$oid": "565ccbd54d88a005130bc72f"
},
"mime_type": "image/jpeg",
"size": 39092
}
python setup.py test
Before start to deploying you need to have root access into a remote server using SSH with a public key.
Install ansible and run:
cp deploy/hosts.example hosts
vim hosts # add your remote server
ansible-playbook -i hosts deploy/site.yml