Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Stubcellを使ってフロントやアプリの開発効率をあげよう
Search
sussan0416
January 19, 2018
Programming
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Stubcellを使ってフロントやアプリの開発効率をあげよう
sussan0416
January 19, 2018
More Decks by sussan0416
See All by sussan0416
Firebaseのイベントが送信されず2週間苦しんだ話
sussan0416
0
870
レイアウトを使い回す 〜ConstraintLayout編〜
sussan0416
0
1.4k
えぇい!フリーランスだ!の前に知っておきたい、お金にまつわる2つの怖〜い話
sussan0416
0
220
Neo4jを用いたカフェ巡り行動の分析
sussan0416
0
1.1k
Other Decks in Programming
See All in Programming
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
速習iPhone Duo対応
yuukiw00w
2
980
R8 の設定見直しでアプリサイズ削減
andpad
0
210
ActionController meets Protocol Buffers
sorah
0
220
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
590
Are APIs Still Relevant in the AI Era?
soyuka
0
460
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
730
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
AWSに止められる覚悟してますか?
morizo_1984
2
530
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
JRuby: Past, Present, and Future
headius
0
230
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
480
How to Talk to Developers About Accessibility
jct
2
570
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
730
Making Projects Easy
brettharned
120
6.8k
The Limits of Empathy - UXLibs8
cassininazir
2
720
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
A Tale of Four Properties
chriscoyier
163
24k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Transcript
StubcellΛͬͯ ϑϩϯτΞϓϦͷ ։ൃޮΛ͋͛Α͏ @sussan_0416 2017/01/19ɹएखΤϯδχΞLT #3
ླʢ@sussan_0416ʣ • 2015৽ଔೖࣾʢ3 ·ͩएखʣ • Android/iOSΞϓϦΤϯδχΞ ʢJava, Kotlin, Swiftʣ •
ݱࡏɺࠂ৴Λ࠷దԽ͢Δػց ֶशΛ୲ ʢpython, Dataflow, PHP etc..ʣ
֓ཁ 1. ϑϩϯτଆ։ൃ͋Δ͋Δͷ 2. Stubcellͷಋೖํ๏ͱ͍ํ 3. StubcellΛࣾͰͬͨࣄྫ
ϑϩϯτΞϓϦͷ։ൃͰ
Α͋͘Δʮʯ
1. APIΑΓϑϩϯτͷ։ൃ͕ ઌߦͪ͠Όͬͨ
2. σόοά͍͚ͨ͠Ͳ API͔Βҙਤͨ͠Ϩεϙϯε͕ ฦͬͯ͜ͳ͍
3. ֎෦ͷAPIΛ͍ͬͯͯɺ SandboxϞʔυ͕ແ͍
։ൃͰΑ͋͘ΔϞϠϞϠ • APIΑΓϑϩϯτ͕։ൃઌߦͨ͠ ˠ ͤΊͯURI͚ͩͰ༻ҙ͠ͱ͍ͯ΄͍͠ʂ • API͔Βҙਤͨ͠Ϩεϙϯε͕ฦͬͯ͜ͳ͍ ˠ ϥϯμϜੑͷ͋ΔͷͳͲݕূ͕ࠔʂ •
SandboxϞʔυ͕ແ͍ ˠ ֎෦ͩͬͨΒͳ͓͞Β͍͠
APIΛϞοΫͨ͠Βղܾʂ
Stubcell ͬͯͷ͕͋ΔΒ͍͠ Stubcell https://github.com/yosuke-furukawa/stubcell
Stubcell • JSONΛฦ͢͜ͱʹಛԽͨ͠stubαʔόʔ • Ϩεϙϯε༰Λఆٛ͢ΔϑΝΠϧʹɺίϝ ϯτΛॻ͖ࠐΊΔʢJSON5ରԠʣ Stubcell ϞοΫ͍ͯ͠ͳ͍URIɺຊདྷͷAPIʹϦΫΤετ͢Δ ϞοΫͨ͠URIɺStubcell͔ΒϨεϙϯε
ಋೖํ๏
npmͰΠϯετʔϧ $ npm -g install stubcell npm WARN deprecated
[email protected]
:
Use uuid module instead /usr/local/bin/stubcell -> /usr/local/lib/node_modules/stubcell/bin/ stubcell.js +
[email protected]
added 110 packages in 14.713s
͍ํ3εςοϓ! • entry.yamlΛॻ͘ʢStubαʔόͷઃఆʣ • ֤URIͷϨεϙϯεΛςΩετϑΝΠϧʹॻ͘ • ίϚϯυϥΠϯ͔Βىಈ͢Δ
͔ΜͨΜ!
entry.yamlʢجຊྫʣ # جຊ - request: url: /hoge method: get response:
status: 200 file: hoge.json # ϨεϙϯεΛॻ͍ͨྫ - request: url: /fuga method: get response: status: 200 body: '{"text": ";͕ͩͶ"}' ←/hogeͷϦΫΤετʹ ɹhoge.jsonͷ༰Λฦ͢ ʢී௨ͷςΩετͰOKʣ ←bodyύϥϝʔλʹ ɹॻ͍ͨྫ
͋ͱىಈ͢Δ͚ͩ $ stubcell Listening on 8090 entry yaml is /Users/ta_suzuki/Documents/stubcell/entry.yaml
silent is false record proxy is undefined loose compare undefined $ stubcell --port 3000ɹɹˡ ϙʔτͷࢦఆ $ stubcell --entry ./entry.yamlɹɹˡ entryϑΝΠϧͷࢦఆ $ stubcell --record_target http://echo.jsontest.comɹɹˡ αʔόͷࢦఆ
͔ΜͨΜ!! γϯϓϧ!!
ࣾͰͬͨࣄྫ
εϚϗΞϓϦ։ൃ Stubcell PC γϛϡϨʔλ ։ൃAPI ։ൃதͷURIΛϞοΫ ։ൃࡁΈͷURI௨ա ։ൃதͷURIΛϞοΫͯ͠ɺ։ൃޮΛ্͛Δྫ APIଆͷ։ൃͷਐḿʹӨڹ͞Εͣɺϑϩϯτଆͷ։ൃΛਐΊΒΕΔΑ͏ʹͳͬͨ!!
֎෦APIར༻ͷϑϩϯτ։ൃ ։ൃAPI ֎෦API Stubcell PC ֎෦ͷAPIΛ༻͍ͯ͠ΔՕॴΛϞοΫͯ͠ɺ։ൃޮΛ্͛Δྫ ِͨ͠JSONΛฦ͢ ଓ͠ͳ͍ ֎෦APIͷϨεϙϯεΛِͰ͖Δ͔Βɺσόοά͘͢͠ͳͬͨ!!
ಋೖͯ͠Α͔ͬͨ͜ͱ • APIଆͷ։ൃͷਐḿʹ͔͔ΘΒͣҰ௨Γͷಈ࡞ ֬ೝ͕Ͱ͖Δ • ҙਤͨ͠ϨεϙϯεΛฦͤΔ͔Βσόοά͠ ͍͢ • entry.yamlϨεϙϯεͷ༰༷ॻʹͳΔ ͠ɺςΩετఆ͔ٛͩΒgitཧ͍͢͠
·ͱΊ • ։ൃதʹΑ͋͘Δʮʯ APIͷ։ൃঢ়گɺ֎෦ͷAPIͷڍಈʹӨڹ͞Εͣʹ։ൃ͍ͨ͠ͱ͖ͬͯ͋ΔΑͶ • StubcellΛ͏ͱɺAPIΛϞοΫͰ͖ͯศར npm -g install stubcell
entry.yamlΛॻ͘ɺϨεϙϯεΛϑΝΠϧʹॻ͘ɺstubcellͰىಈ͢Δ • StubcellΛࣾͰͬͨࣄྫ εϚϗΞϓϦ։ൃͱ֎෦APIΛͬͨϑϩϯτΞϓϦͷࣄྫΛհ