https://github.com/ruby-grape/grape-with-roar
A demo of using Grape with Roar and some non-trivial HAL presenters.
https://github.com/ruby-grape/grape-with-roar
Last synced: about 1 year ago
JSON representation
A demo of using Grape with Roar and some non-trivial HAL presenters.
- Host: GitHub
- URL: https://github.com/ruby-grape/grape-with-roar
- Owner: ruby-grape
- License: mit
- Created: 2014-07-18T21:22:58.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-09-25T21:08:38.000Z (over 9 years ago)
- Last Synced: 2025-04-04T17:51:48.855Z (about 1 year ago)
- Language: Ruby
- Size: 83 KB
- Stars: 17
- Watchers: 4
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Grape API with Roar
===================
[](https://travis-ci.org/ruby-grape/grape-with-roar)
[](https://gemnasium.com/ruby-grape/grape-with-roar)
[](https://codeclimate.com/github/ruby-grape/grape-with-roar)
A [Grape](http://github.com/ruby-grape/grape) API that uses [Roar](https://github.com/apotonick/roar).
See
---
Try me [here](http://grape-with-roar.herokuapp.com/). In Chrome, best viewed with the [JSONView Plugin](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc?hl=en).
Run
---
```
$ bundle install
$ rackup
[2013-06-20 08:57:58] INFO WEBrick 1.3.1
[2013-06-20 08:57:58] INFO ruby 1.9.3 (2013-02-06) [x86_64-darwin11.4.2]
[2013-06-20 08:57:58] INFO WEBrick::HTTPServer#start: pid=247 port=9292
```
### Hello World
Navigate to [localhost:9292/api](http://localhost:9292/api) with a browser. This is a hypermedia API, so all links are clickable.
Hyperclient
-----------
This is a good demo to use with [Hyperclient](https://github.com/codegram/hyperclient). Check out [splines_endpoint_with_hyperclient_spec.rb](/spec/api/splines_endpoint_with_hyperclient_spec.rb) for a complete example that retrieves, creates, updates and deletes splines.
ActiveModel
-----------
This project uses ActiveModel and defines a dummy [Spline](app/models/spline.rb) class.
ActiveRecord
------------
Check out the [with-activerecord branch](https://github.com/ruby-grape/grape-with-roar/tree/with-activerecord) for a complete example that uses ActiveRecord and a PostgreSQL database.
Mongoid
-------
Check out the [with-mongoid branch](https://github.com/ruby-grape/grape-with-roar/tree/with-mongoid) for a complete example that uses Mongoid and a MongoDB database.
Copyright and License
---------------------
Copyright (c) 2014-2016 Daniel Doubrovkine
MIT License, see [LICENSE](LICENSE) for details.