Email driven web image gallery
- Ruby 2.2.0
- ImageMagick
- Postgres
- Redis
$ git clone git@github.com:b0oh/picto.git
$ cd picto
$ bundle
$ cp config/config.yml.example config/config.yml
$ open config/config.yml
$ bundle exec rake db:create db:migrate
$ bundle exec rackup
$ RACK_ENV=test bundle exec rake db:create db:migrate
$ bundle exec rake
$ bundle exec sidekiq -c 5 -r ./lib/picto.rb
-
200 application/json
-
204
-
400 application/json
{ "error": { "status": "invalid_param", "message": "error message" } }
-
404 application/json
{ "error": { "status": "not_found", "message": "not found" } }
-
422 application/json
{ "error": { "status": "unprocessable_entity", "message": "error message" } }
GET: /api/config
Response:
Status: 200 OK
{ "config": {
"mail": "to@send_pics"
}
}
Request: | ||
---|---|---|
offset |
optional | Skip number of results from beginning. |
limit |
optional | Number of results to return per page. |
GET: /api/images
Response:
Status: 200 OK
{ "images": [
{
"id": "abcdef",
"url": "https://url-to-image",
"width": 400,
"height": 300,
"user": {
"id": 1,
"email": "email"
}
}
],
"pagination": {
"total": 351,
"count": 4,
"offset": 347,
"limit": 100
}
}
Request: | ||
---|---|---|
sender |
required | Sender's email. |
attachment-count |
optional | Number of sended attachments |
attachment-#{n} |
optional | Attachment as multipart data |
POST: /api/images/post
Response:
Status: 204 OK