This is a simple API with two end points. The GET with return a named clock with the current time. The PUT will return the previously or newly named clock with the time that has been input.
The aim of this project was to use GrapeAPI with persistence and to integrate Swagger Docs for easier navigation and understanding of the API.
The final part of the project was to implement logging.
- Grape v0.11.0
- Grape-entity v0.4.5
- Grape-swagger v0.10.1
- Log4r v1.1.10
- MongoDB v1.3.1
- Mongoid v4.0.2
##To Run the App Locally
You will need to have Ruby installed along with Gem and Bundle (I use Ruby Version Manager and you can get started here).
#####From the commandline:
-
To run the app on your local machine clone the repository: git clone https://github.com/ruthearle/clock.git
-
Navigate to the newly created repository: cd clock
-
Install dependencies: bundle
-
Start the app: bundle exec rackup
-
Then go to your favourite browser and type: http://localhost:9292/api/swagger/index.html
-
And play!
##How to run the test suite Clock is fully tested with Rspec/Rack Test.
#####From the commandline:
- Navigate to the directory (see step 2. above) and type: rspec
##Improvements?
I would fully implement the logging functionality using TDD because the current implementation was not done his way.