This service provides a RESTful API which provides random functionality. It is written in Python using Flask.
The Swagger Spec defines the interface of the service.
The service can be run as a Docker container or as a Python process.
docker run --pull always --publish 5000:5000 earnestresearch/take-home-exercise-random-api:latest
Install libraries:
pip3 install -r requirements.txt
Run:
python3 -m flask run
curl 'http://localhost:5000/random/default/choice?value=3&value=5&value=7'
{"value":"7"}
- Bump the version in the VERSION file
- Use a Docker Hub account which is a member of the Earnest Research organisation
./docker-build-and-publish <Docker Hub username>