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

5分でわかるServer Side Swift Vaporの魅力

53e2d354b3299d64a54af680865516d5?s=47 Sato Takeshi
September 17, 2017

5分でわかるServer Side Swift Vaporの魅力

iOSDC 2017 9/17のLTで発表しました。
https://iosdc.jp/2017/

The will of a rich man.
https://the-will-of-a-rich-man.herokuapp.com/

53e2d354b3299d64a54af680865516d5?s=128

Sato Takeshi

September 17, 2017
Tweet

More Decks by Sato Takeshi

Other Decks in Technology

Transcript

  1. 5෼ͰΘ͔ΔServer Side Swift Vaporͷັྗ 2017೥9݄17೔ɹ ࠤ౻߶࢜ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17

    1
  2. Who am I ࠤ౻߶࢜ (@hatakenokakashi) MAMORIOגࣜձࣾͰiOSΤϯδχΞΛ ͍ͯ͠·͢ɻ ։ൃ͔ΒAppStore΁ͷϦϦʔε࡞ۀ΋ ͯ͠·͢ɻ http://blog.personal-factory.com/

    5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 2
  3. Swift͕޷͖Ͱ͢ʂ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 3

  4. Swift͕େ޷͖ͳiOSΤ ϯδχΞͷΈͳ͞Μ!! 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 4

  5. ΞϓϦ͚ͩͰͳ͘ɺαʔ όʔαΠυ΋։ൃͰ͖ͨ Β͖ͯ͢͡Όͳ͍Ͱ͢ ͔ʁ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 5

  6. αʔόʔαΠυ΋Ͱ͖ͨ Βࣗ෼Ͱ࡞ΕΔϓϩδΣ Ϋτͷ෯͕޿͕Γ·͢ɻ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 6

  7. 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 7

  8. ͪΐͬͱ଴ͬͨʂ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 8

  9. Swiftʹ͸αʔόʔαΠυ΋͋Δʂʂ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 9

  10. 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 10

  11. VaporͰWebΞϓϦΛ࡞Γ·ͨ͠ https://the-will-of-a-rich-man.herokuapp.com/ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 11

  12. Vaporͷಛ௃ • Server Side Swift • ߴ͍ύϑΥʔϚϯε • υΩϡϝϯτ͕ॆ࣮ •

    ؆ܿͳϝιουɺ؆୯؀ڥߏங 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 12
  13. 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 13

  14. 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 14

  15. υΩϡϝϯτ͕ॆ࣮ ໎ͬͨΒެࣜSlackͰ΋ฉ͚·͢ɻ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 15

  16. CLIπʔϧͰ؆୯ߏங // Vapor toolboxͷΠϯετʔϧ brew install vapor // Πϯετʔϧͷ֬ೝ vapor

    --help 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 16
  17. ΞϓϦέʔγϣϯ࡞੒ɺϏϧυ&ϥϯ $ vapor new FirstVapor --template=web $ cd FirstVapor/ $

    vapor build $ vapor run 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 17
  18. http://0.0.0.0:8080/ ͰWebαʔόʔ্ཱ͕͕ͪΔ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 18

  19. XcodeͷϓϩδΣΫτ࡞੒ $ vapor xcode 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 19

  20. 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 20

  21. HerokuʹσϓϩΠ $ git add ./ $ git commit -m "init

    commit" $ vapor heroku init 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 21
  22. Vaporͷ࢖͍ํ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 22

  23. Vaporͷ࢖͍ํ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 23

  24. Vaporͷ࢖͍ํ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 24

  25. Vaporͷ࢖͍ํ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 25

  26. Vaporͷ࢖͍ํ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 26

  27. Vaporͷ࢖͍ํ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 27

  28. Vaporͷ࢖͍ํ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 28

  29. Ϩεϙϯε GET http://0.0.0.0:8080/json -> {"id":1,"name":"tommy","age":10} 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 29

  30. ؆୯Ͱ͠ΐ͏ʁ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 30

  31. ·ͱΊ • Server Side Swift Vapor • ߴ͍ύϑΥʔϚϯε • ॆ࣮ͷυΩϡϝϯτ

    • ؆ܿͳϝιουɺ؆୯؀ڥߏங 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 31
  32. https://the-will-of-a-rich-man.herokuapp.com/ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 32