Skip to content

bruz/bookshelf-delivery-example

Repository files navigation

This is an extension of the Bookshelf app featured in Hanami's Getting Started Guide, mainly as an exploration of taking an app's use cases and providing multiple delivery mechanisms around them: a browser UI, an API, and a command line interface. It's the first thing I've done with Hanami, so feedback on anything that doesn't seem to fit with the Hanami way of doing things will be happily received.

Current status

Travis Gemnasium Code Climate

Getting started

Prerequisites:

  • Ruby 2.2 or 2.3
  • PostgreSQL

Setup:

git clone https://github.com/bruz/bookshelf-delivery-example.git
cd bruz/bookshelf-delivery-example
hanami db create
hanami db migrate

Using the CLI (doesn't require a running server):

./bin/bookshelf add "Hard-Boiled Wonderland and the End of the World" "Haruki Murakami"

Starting the server:

hanami server

The web UI will now be available at to browse at http:https://localhost:2300.

The REST-like API lives under /api/books, so for example you can do:

curl http:https://localhost:2300/api/books -X POST -d 'title=The Count of Monte Cristo&author=Alexander Dumas'

License

This project is licensed under the MIT Licence.

About

Hanami example app with multiple delivery mechanisms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages