Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Stubcellを使ってフロントやアプリの開発効率をあげよう

sussan0416
January 19, 2018

 Stubcellを使ってフロントやアプリの開発効率をあげよう

sussan0416

January 19, 2018
Tweet

More Decks by sussan0416

Other Decks in Programming

Transcript

  1. ླ໦޹޺ʢ@sussan_0416ʣ • 2015೥৽ଔೖࣾʢ3೥໨ ·ͩएखʣ • Android/iOSΞϓϦΤϯδχΞ
 ʢJava, Kotlin, Swiftʣ •

    ݱࡏ͸ɺ޿ࠂ഑৴Λ࠷దԽ͢Δػց ֶशΛ୲౰
 ʢpython, Dataflow, PHP etc..ʣ 
  2. 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ʢجຊྫʣ # جຊ - 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ύϥϝʔλʹ ɹ௚઀ॻ͍ͨྫ 
  4. ͋ͱ͸ىಈ͢Δ͚ͩ $ 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ɹɹˡ αʔόͷࢦఆ 
  5. ·ͱΊ • ։ൃதʹΑ͋͘Δʮ΋΍΋΍ʯ
 APIͷ։ൃঢ়گ΍ɺ֎෦ͷAPIͷڍಈʹӨڹ͞Εͣʹ։ൃ͍ͨ͠ͱ͖ͬͯ͋ΔΑͶ • StubcellΛ࢖͏ͱɺAPIΛϞοΫͰ͖ͯศར
 npm -g install stubcell


    entry.yamlΛॻ͘ɺϨεϙϯεΛϑΝΠϧʹॻ͘ɺstubcellͰىಈ͢Δ • StubcellΛࣾ಺Ͱ࢖ͬͨࣄྫ
 εϚϗΞϓϦ։ൃͱ֎෦APIΛ࢖ͬͨϑϩϯτΞϓϦͷࣄྫΛ঺հ