Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

Who am I ࠤ౻߶࢜ (@hatakenokakashi) MAMORIOגࣜձࣾͰiOSΤϯδχΞΛ ͍ͯ͠·͢ɻ ։ൃ͔ΒAppStore΁ͷϦϦʔε࡞ۀ΋ ͯ͠·͢ɻ http://blog.personal-factory.com/ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 2

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

Vaporͷಛ௃ • Server Side Swift • ߴ͍ύϑΥʔϚϯε • υΩϡϝϯτ͕ॆ࣮ • ؆ܿͳϝιουɺ؆୯؀ڥߏங 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 12

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

CLIπʔϧͰ؆୯ߏங // Vapor toolboxͷΠϯετʔϧ brew install vapor // Πϯετʔϧͷ֬ೝ vapor --help 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 16

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

HerokuʹσϓϩΠ $ git add ./ $ git commit -m "init commit" $ vapor heroku init 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 21

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

·ͱΊ • Server Side Swift Vapor • ߴ͍ύϑΥʔϚϯε • ॆ࣮ͷυΩϡϝϯτ • ؆ܿͳϝιουɺ؆୯؀ڥߏங 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 31

Slide 32

Slide 32 text

https://the-will-of-a-rich-man.herokuapp.com/ 5෼ͰΘ͔ΔServer-side Swift Vaporͷັྗ 2017/9/17 32