Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Grape APIs
Search
Christopher Hein
December 18, 2012
Programming
2
160
Grape APIs
Christopher Hein
December 18, 2012
Tweet
Share
More Decks by Christopher Hein
See All by Christopher Hein
Controllers and Service Catalog; The Power of CRDs
christopherhein
0
150
Extending Kubernetes with Operators/Controllers
christopherhein
0
18
Rails Engines
christopherhein
0
110
Other Decks in Programming
See All in Programming
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
690
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
110
Outline View in SwiftUI
1024jp
1
330
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
みんなでプロポーザルを書いてみた
yuriko1211
0
280
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Git: the NoSQL Database
bkeepers
PRO
427
64k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Side Projects
sachag
452
42k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
4 Signs Your Business is Dying
shpigford
180
21k
Happy Clients
brianwarren
98
6.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Code Reviewing Like a Champion
maltzj
520
39k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Transcript
APIs
Rails
Don’t really fit together.
Sinatra
mmm tasty...
But I’m good programmer... http://threevirtues.com/ (1)
Enter...
Grape 0.2.0!!!
Why@?#$%!
Simple... class API < Grape::API get :users do # omitted
for awesomeness end end
Versions... class API < Grape::API version “v1” get :users do
# omitted for awesomeness end end
Helpers... class API < Grape::API helpers do def current_user User.find
params[:id] end end # omitted for awesomeness end
Multi-file... class API < Grape::API version “v1” mount API_v1 #
omitted for awesomeness end
Describing... class API < Grape::API desc "Returns users", {params:{id: {}}}
get :users do # omitted for awesomeness end end
Demo...