- Do you like hippos?
+ Who doesn't like hippos?

And this is how it all started.

How to run it?

If you are brave enough you can try it, but (advice here) it's not finished

We're using MongoDB as our database. If you don't have a MongoDB database at hand, go
go MongoHQ and create a database there. There's a free layer and it will save all the fuss
of installing and configuring it.

If you go for a Database in MongoHQ, your connection string will be something like this:

	MONGODB_URL=mongodb:// \
	    go run main.go

Otherwise, if you're using a local install, you can run it as:

	MONGODB_URL=mongodb://localhost:27017/apihippo \
	    go run main.go

### subdomains

It's quite important in case that you want to access to the hippo images that
you configure the subdomains. For doing that, the easiest way is to edit your
`/etc/hosts` and add the following line:


### POST a hippo

	curl -H "Accept: application/json; \
                 Content-Type: multipart/form-data" \
            http://localhost:8000/ --form "data=@/tmp/hippo.jpg"

### PUT a hippo (vote)

	curl -H "Accept: application/json" -X PUT \

### GET a hippo

	curl -H "Accept: application/json" \

### GET all the hippos paginated

	curl -H "Accept: application/json" \
	    http://localhost:8000/?page=N  # page is optional

And just the verified:

	curl -H "Accept: application/json" \

I am pretty sure that you are clever enough to get the non verified ones :)

### GET the web

	curl http://localhost:8000

### GET a hippo image

Please, remember to configure the subdomain on your `/etc/hosts` before
accessing to this URL, if not, it's not going to work:


### GET a random hippo

Please, read the advice above about `/etc/hosts` and then:



### Important

- Check that the file is an image before storing it in our CDN.
- Return the proper time of the image on the Header (we are always returning
- Configure a proper CDN.
- Properly test the pagination/limits with different hippos.
- Move the documentation to some place where it can be demoed: Swagger could be
  a good option.
- Change paginated output to something more HAL style.

### A lot of things to do anyway...

	grep TODO . -R

Imports 4 package(s) ΒΆ