Upload
andy-wang
View
1.260
Download
2
Embed Size (px)
DESCRIPTION
a topic I shared in Xi'an OpenParty 2013/07/27
Citation preview
Copyright 2010, Intridea Inc. All Rights Reserved.
RESTful API On Grape
[email protected] 2013/07/27 @XianOpenParty
Copyright 2010, Intridea Inc. All Rights Reserved.
Introduction
王要弟 == Andy Wang WangYaodi.com
Senior Ruby/Rails Enginner @intridea Weibo/Twitter/Github/RubyChina: @yorzi
Copyright 2010, Intridea Inc. All Rights Reserved.
What’s Grape?
Copyright 2010, Intridea Inc. All Rights Reserved.
Generalized Rapid APIs Erector
https://github.com/intridea/grape/blob/master/README.md
Copyright 2010, Intridea Inc. All Rights Reserved.
“An opinionated micro-framework
for creating RESTful APIs in Ruby”
Copyright 2010, Intridea Inc. All Rights Reserved.
REpresentational State Transfer
http://www.ruanyifeng.com/blog/2011/09/restful.html
Copyright 2010, Intridea Inc. All Rights Reserved.
Grape APIs are Rack applications
Copyright 2010, Intridea Inc. All Rights Reserved.
http://guides.rubyonrails.org/rails_on_rack.html
Copyright 2010, Intridea Inc. All Rights Reserved.
Basic API
Copyright 2010, Intridea Inc. All Rights Reserved.
Copyright 2010, Intridea Inc. All Rights Reserved.
Add Prefix
Copyright 2010, Intridea Inc. All Rights Reserved.
Add Namespace
Copyright 2010, Intridea Inc. All Rights Reserved.
Add Version
Copyright 2010, Intridea Inc. All Rights Reserved.
Authentication
Copyright 2010, Intridea Inc. All Rights Reserved.
Use Helpers
Copyright 2010, Intridea Inc. All Rights Reserved.
Raise Error
Copyright 2010, Intridea Inc. All Rights Reserved.
Exception Handling
Copyright 2010, Intridea Inc. All Rights Reserved.
JSONP & CORS
Copyright 2010, Intridea Inc. All Rights Reserved.
Rabl Template
Copyright 2010, Intridea Inc. All Rights Reserved.
Cookies
Copyright 2010, Intridea Inc. All Rights Reserved.
Redirecting
Copyright 2010, Intridea Inc. All Rights Reserved.
Logging
Copyright 2010, Intridea Inc. All Rights Reserved.
https://github.com/intridea/grape/blob/master/README.md
More Features
Copyright 2010, Intridea Inc. All Rights Reserved.
Run Rack App
Copyright 2010, Intridea Inc. All Rights Reserved.
Work with Rails
Copyright 2010, Intridea Inc. All Rights Reserved.
Resources https://github.com/intridea/grape/wiki
Copyright 2010, Intridea Inc. All Rights Reserved.
Question?
Copyright 2010, Intridea Inc. All Rights Reserved.
Thank You!