Restful API On Grape
-
Upload
andy-wang -
Category
Technology
-
view
1.264 -
download
2
description
Transcript of Restful API On Grape
![Page 1: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/1.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
RESTful API On Grape
[email protected] 2013/07/27 @XianOpenParty
![Page 2: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/2.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Introduction
王要弟 == Andy Wang WangYaodi.com
Senior Ruby/Rails Enginner @intridea Weibo/Twitter/Github/RubyChina: @yorzi
![Page 3: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/3.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
What’s Grape?
![Page 4: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/4.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Generalized Rapid APIs Erector
https://github.com/intridea/grape/blob/master/README.md
![Page 5: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/5.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
“An opinionated micro-framework
for creating RESTful APIs in Ruby”
![Page 6: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/6.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
REpresentational State Transfer
http://www.ruanyifeng.com/blog/2011/09/restful.html
![Page 7: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/7.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Grape APIs are Rack applications
![Page 8: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/8.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
http://guides.rubyonrails.org/rails_on_rack.html
![Page 9: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/9.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Basic API
![Page 10: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/10.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
![Page 11: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/11.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Add Prefix
![Page 12: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/12.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Add Namespace
![Page 13: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/13.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Add Version
![Page 14: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/14.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Authentication
![Page 15: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/15.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Use Helpers
![Page 16: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/16.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Raise Error
![Page 17: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/17.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Exception Handling
![Page 18: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/18.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
JSONP & CORS
![Page 19: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/19.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Rabl Template
![Page 20: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/20.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Cookies
![Page 21: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/21.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Redirecting
![Page 22: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/22.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Logging
![Page 23: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/23.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
https://github.com/intridea/grape/blob/master/README.md
More Features
![Page 24: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/24.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Run Rack App
![Page 25: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/25.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Work with Rails
![Page 26: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/26.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Resources https://github.com/intridea/grape/wiki
![Page 27: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/27.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Question?
![Page 28: Restful API On Grape](https://reader033.fdocuments.net/reader033/viewer/2022052315/554ae547b4c905a37c8b5045/html5/thumbnails/28.jpg)
Copyright 2010, Intridea Inc. All Rights Reserved.
Thank You!