Rails4環境でGrapeとGrape::Entityのコードサンプル
Grapeで簡単にAPIが作れてしまいます、というエントリーを読んで、APIを作ってリリースしたのでメモ。
What is Grape?
Grape is a REST-like API micro-framework for Ruby. It’s designed to run on Rack or complement existing web application frameworks such as Rails and Sinatra by providing a simple DSL to easily develop RESTful APIs. It has built-in support for common conventions, including multiple formats, subdomain/prefix restriction, content negotiation, versioning and much more.
プロダクトの最初の頃に作っていた超ベーシックなサンプルです。
Rails4 + grape 0.7.0 + grape-entity 0.4.2 環境で動作確認済みです。
Github
Full Documentation