Shakespearean Pokémon description api service
205
Provides a Shakespearean description of named pokémon species.
Leverages the following upstream APIs:
Make sure you have Docker Desktop installed. First build the image from root of this repository:
docker build --tag shakesemon --file Dockerfile .
Then choose a port and run shakesemon:
export PORT=8000
docker run -e BIND_ADDRESS=0.0.0.0:${PORT} -p ${PORT}:${PORT} shakesemon
If you want to skip the build step, you can run latest build from Dockerhub:
export PORT=8000
docker run -e BIND_ADDRESS=0.0.0.0:${PORT} -p ${PORT}:${PORT} olidacombe/shakesemon
Alternatively, if you have a Rust toolchain installed, you can compile and run the service using:
cargo run
To query your favorite pokémon using curl when running locally as described above:
$ curl -s localhost:8000/pokemon/pikachu
{
"name": "pikachu",
"description": "At which hour several of these pokémon gather, their electricity couldst buildeth and cause lightning storms."
}
You can configure the service with the following environment variables:
BIND_ADDRESS - ip:port specification for binding, defaults to 127.0.0.1:0 (i.e. loopback address with port assigned by the OS)POKEAPI_URI - specify alternative translator endpoint (e.g. if you want to point at a caching proxy)SHAKESPEARE_TRANSLATOR_URI - specify alternative translator endpoint (e.g. if you want to point at a caching proxy that might also tack on an api key for you)Items I'd like to take care of in the future include:
response.contents.translated and returning "something failed in translation").404X-Funtranslations-Api-Secret)X-Funtranslations-Api-Secret header in the client request for users who are paid-up funtranslationistas.Content type
Image
Digest
Size
31.9 MB
Last updated
over 5 years ago
docker pull olidacombe/shakesemon