Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.7 KB

README.md

File metadata and controls

42 lines (34 loc) · 1.7 KB

imagenie

imagenie is a simple web app for RESTful image hosting intended for learning and study

Try this

Warning: before starting, go get some kitten JPEGs and make sure the CouchDB server is listening on localhost:5984

# start app
coffee images.coffee
# create an album named 'kittens' with thumbnails 120 pixels tall/wide
curl -X PUT -H 'Content-Type: application/json' --data '{"thumb" : {"max_height" : 120, "max_width" : 120}}' http://localhost:8000/kittens
# post a picture to the album
curl -i -H 'Content-Type: image/jpeg' --data-binary @/path/to/kitten/picture.jpg http://localhost:8000/kittens
# -> {"ok":true,"id":"2280dd0d2ecd3ebf091bea9d7d005d49"}
# get your picture back (metadata will be striped out)
curl -o /tmp/kitten.jpg http://localhost:8000/kittens/2280dd0d2ecd3ebf091bea9d7d005d49
# get the thumbnail
curl -o /tmp/kitten-thumb.jpg http://localhost:8000/kittens/thumb/2280dd0d2ecd3ebf091bea9d7d005d49
# get some image metadata in JSON format
curl -H 'Accept: application/json' http://localhost:8000/kittens/2280dd0d2ecd3ebf091bea9d7d005d49

'thumb' is an arbitrary size identifier, you can specify as many as you want like profile, reduced, email, etc.

Tech

Technologies used in this project (in no particular order)

License

Licensed under the MIT license (see LICENSE for details)