Slide 1

Slide 1 text

Server SideSwift Swift ! " @akosma in Twitter, Github, Medium & LinkedIn. © akosma 2016 1

Slide 2

Slide 2 text

Kitura1 1 http://www.kitura.io © akosma 2016 2

Slide 3

Slide 3 text

Kiturawwdc wwdc https://developer.apple.com/videos/play/wwdc2016/415/ © akosma 2016 3

Slide 4

Slide 4 text

Kituraibm ibm https://developer.ibm.com/swift/ © akosma 2016 4

Slide 5

Slide 5 text

import Kitura let router = Router() router.get("/") { request, response, next in response.send("Hello, World!") next() } Kitura.addHTTPServer(onPort: 8090, with: router) Kitura.run() https://github.com/IBM-Swift/Kitura © akosma 2016 5

Slide 6

Slide 6 text

Perfect2 2 http://perfect.org © akosma 2016 6

Slide 7

Slide 7 text

import PerfectLib import PerfectHTTP import PerfectHTTPServer let server = HTTPServer() var routes = Routes() routes.add(method: .get, uri: "/", handler: { request, response in response.setHeader(.contentType, value: "text/html") response.appendBody(string: "

Hello, world!

") response.completed() } ) server.addRoutes(routes) server.serverPort = 8181 do { try server.start() } catch PerfectError.networkError(let err, let msg) { print("Network error thrown: \(err) \(msg)") } https://github.com/PerfectlySoft/Perfect © akosma 2016 7

Slide 8

Slide 8 text

Vapor3 3 http://vapor.codes © akosma 2016 8

Slide 9

Slide 9 text

import Vapor let drop = Droplet() drop.get("hello") { req in return "Hello, world." } drop.run() https://github.com/vapor/vapor © akosma 2016 9

Slide 10

Slide 10 text

Zewo5 5 http://www.zewo.io © akosma 2016 10

Slide 11

Slide 11 text

import HTTPServer let router = BasicRouter { route in route.get("/hello") { request in return Response(body: "Hello, world!") } } let server = try Server(configuration: ["port": 8080], responder: router) try server.start() https://github.com/Zewo/Zewo © akosma 2016 11

Slide 12

Slide 12 text

Server APIs Workgroup group https://swift.org/blog/server-api-workgroup/ © akosma 2016 12

Slide 13

Slide 13 text

Server Side Standards for Swift – S4 4 https://github.com/open-swift/S4 © akosma 2016 13

Slide 14

Slide 14 text

import PackageDescription let package = Package( dependencies: [ .Package(url: "https://github.com/open-swift/S4.git", majorVersion: 0, minor: 11) ] ) https://github.com/open-swift/S4 © akosma 2016 14

Slide 15

Slide 15 text

swift package generate-xcodeproj © akosma 2016 15

Slide 16

Slide 16 text

Perfect Vapor Kitura Zewo S4 Inspiration Ruby on Rails Laravel Express.js Go (libmill) Open Initiative Design Monolithic Modular IBM Modular In progress Deployment nginx, Docker, Heroku Bluemix, AWS, Heroku… Apache, nginx, Bluemix Databases Mongo, MySQL, FileMaker… Mongo, MySQL… Templating Mustache Leaf Mustache License Apache MIT Apache MIT MIT Stars0 9200 7200 4800 1400 100 More StORM, Websockets, FastCGI Websockets WWDC16 415 0 as of November 2016 © akosma 2016 16

Slide 17

Slide 17 text

Swift Protobuf buf https://github.com/apple/swift-protobuf © akosma 2016 17

Slide 18

Slide 18 text

SwiftCGI CGI https://github.com/allevato/SwiftCGI and https://github.com/ianthetechie/SwiftCGI © akosma 2016 18

Slide 19

Slide 19 text

Newsletter letter https://www.serverswift.tech © akosma 2016 19

Slide 20

Slide 20 text

Workshop —3 sessions of 2h each: 11:30, 14:30 & 16:30 —Build a web API & iOS client 100% Swift —Specifications —Free choice of tools & frameworks —Team effort —Guidance and support —Fun! © akosma 2016 20

Slide 21

Slide 21 text

Competition! —Number of implemented use cases —Code coverage —Weighted by number of team members —Imagination ! with a trophy! " chocolate! © akosma 2016 21

Slide 22

Slide 22 text

Schedule Time Thursday 10th Friday 11th 09:00 - 09:30 Registrations Welcome back 09:30 - 11:30 Presentations Work Session 4 11:30 - 13:30 Work Session 1 Work Session 5 13:30 - 14:30 Lunch Lunch 14:30 - 16:30 Work Session 2 Work Session 6 16:30 - 18:30 Work Session 3 Presentations & End © akosma 2016 22

Slide 23

Slide 23 text

Thanks!! Questions? ! https://speakerdeck.com/akosma © akosma 2016 23