docker run --rm -v $(pwd):/src centurylink/golang-builder
docker-compose up
Implement an HTTP server with the following routes:
/generate/png/{width_px}/{height_px}
- returns a blackimage/png
that's of the specified width and height/generate/jpg/{width_px}/{height_px}
- returns a blackimage/jpeg
that's of the specified width and height/stats
- returnsapplication/json
with the number of images generated since the server was started and the average width and height of those images.
For the /stats
route, the json should look like this:
{
"num_images": 1,
"average_width_px": 123,
"average_height_px": 456
}