This is an api system that is designed to answer the coding challenge
It provides a few RESTful endpoints as follows:
GET /api/v1/:a/add/:b => Returns the result of a + b
GET /api/v1/:a/sub/:b => Returns the result of a - b
GET /api/v1/:a/mul/:b => Returns the result of a * b
GET /api/v1/:a/div/:b => Returns the result of a / b
GET /api/v1/:a/fact => Returns the result of a!
Input for a & b is any integer or float value. Passing in strings of arbitrary nature will force an error to be raised
responses to API calls are in JSON format, and will be in the format {status: :ok, result: :res} for successful operations and an error payload will be returned where errors are encountered
A very simple Dockerfile is provided to run this in a container: docker build -it essjayhch/nvm_kata . will run this build locally.
the build script should build the container. It can be triggered from the command line by running docker_start.sh
DockerHub is also configured to auto-build on commit to master the repository can be found at Dockerhub
A basic test suite has been provided, which can be accessed and run by running bundle exec rake test
Some linting for the user application code has been set up to run. This can be run by running bundle exec rake rubocop. The included .rubocop.yml file limits the tests to the non-api parts of the code (as rubocop invariably has a large amount of tweaking for rails apps otherwise)
In order to build a basic tarball of this application, there is a build.sh script provided. This runs bundle install, runs the linting and test suite methods, and if that succeeds, it then constructs a tarball for the project in the parent directory called ../nvm_kata.tar.gz
Tidy the script so it doesn't include so much noise and/or git headers
Content type
Image
Digest
Size
369.9 MB
Last updated
about 7 years ago
docker pull essjayhch/nvm_kata