SlideShare a Scribd company logo
@Chris__Bailey | Swift@IBM #swiftsummit
Swift @ IBM Engineering Team
Chris Bailey(@Chris__Bailey)
November 7th, 2016
Pushing Swift to the Server
@Chris__Bailey | Swift@IBM #swiftsummit
Why Swift on the Server?
@Chris__Bailey | Swift@IBM #swiftsummit
Performant Applications
4.0	 4.3	
15.8	
134.2	
0.0	
20.0	
40.0	
60.0	
80.0	
100.0	
120.0	
				
Duration(s)
(lowerisbetter)
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
@Chris__Bailey | Swift@IBM #swiftsummit
15.0	
32.2	
25.3	
54.6	
0.0	
10.0	
20.0	
30.0	
40.0	
50.0	
60.0	
			
Low Memory
MemoryUsage(MB)
(lowerisbetter)
http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
@Chris__Bailey | Swift@IBM #swiftsummit
Swift is ideal for Cloud
@Chris__Bailey | Swift@IBM #swiftsummit@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
MARS
@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
1998 Mars Climate ORbiteR
@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
DeC 11: Launch from Cape Canaveral1998 Mars Climate ORbiteR
@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
1998 Mars Climate ORbiteR
DeC 11: Launch from Cape Canaveral
@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
1999 Mars Climate ORbiteR
Sept 23rd: Lost Radio Contact
@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
1999 Mars Climate ORbiteR
Sept 25th: Mission Declared a LOSS
@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
PLANNED TRAJECTORY
@Chris__Bailey | Swift@IBM #swiftsummit
PLANNED TRAJECTORY
TCM-4
@Chris__Bailey | Swift@IBM #swiftsummit
PLANNED TRAJECTORY
TCM-4
@Chris__Bailey | Swift@IBM #swiftsummit
PLANNED TRAJECTORY
TCM-4
226 KM
@Chris__Bailey | Swift@IBM #swiftsummit
PLANNED TRAJECTORY
TCM-4
ACTUAL TRAJECTORY
226 KM
@Chris__Bailey | Swift@IBM #swiftsummit
PLANNED TRAJECTORY
TCM-4
ACTUAL TRAJECTORY
226 KM
TCM-4
@Chris__Bailey | Swift@IBM #swiftsummit
PLANNED TRAJECTORY
TCM-4
TCM-4 ACTUAL TRAJECTORY
226 KM
@Chris__Bailey | Swift@IBM #swiftsummit
PLANNED TRAJECTORY
TCM-4
ACTUAL TRAJECTORY
226 KM
57 KM
TCM-4
@Chris__Bailey | Swift@IBM #swiftsummit@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
Lockheed Martin

Ground SoftwareNasa Jet Propulsion Laboratory

Trajectory Calculation Software
@Chris__Bailey | Swift@IBM #swiftsummit
Lockheed Martin

Ground Software
Nasa Jet Propulsion Laboratory

Trajectory Calculation Software
SIS

(Software Interface Specification)
Total Impulse
pounds-seconds
(United States Customary Unit)
newton-seconds
(International System of Units)
11.488
@Chris__Bailey | Swift@IBM #swiftsummit
“Software interop is hard”
@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
“Software interop is hard”
—Rocket Scientists
@Chris__Bailey | Swift@IBM #swiftsummit
@Chris__Bailey | Swift@IBM #swiftsummit
Siloed Development
API

Specification
Collaborate
on API
Collaborate
on API
Create
Deploy
Create
Deploy
@Chris__Bailey | Swift@IBM #swiftsummit
Collaborate
on Project
Collaborate
on Project
Collaborative Development
Deploy DeployGenerate
API

Specification
@Chris__Bailey | Swift@IBM #swiftsummit
Swift Development
Collaborate on
Swift Project
Deploy DeployGenerate
Swagger API

Specification
Collaborate on
Swift Project
@Chris__Bailey | Swift@IBM #swiftsummit
Collaboratively Building

Applications
@Chris__Bailey | Swift@IBM #swiftsummit
December 3rd, 2015
Apache 2.0 Software Licence
Swift Everywhere
@Chris__Bailey | Swift@IBM #swiftsummit
Kitura: A Swift Web Framework and HTTP Server
http://kitura.io
@Chris__Bailey | Swift@IBM #swiftsummit
Server / Cloud DeploymentServer / Cloud DeploymentApple Client Deployment
Client Facing App
Client-Specific
Libraries
Kitura Web Framework
Swift
Standard

Library
Foundation Dispatch
Swift
Standard

Library
Foundation Dispatch
Networking
Security
HTTPParsing
Application
Libraries
Application Specific Cloud Services
Server-Specific Libraries
Application
Libraries
Consistent
Runtime across
Clients/Servers
Kitura-based Server!
Built with Dispatch &
Foundation
Swift
“Server”
APIs
Application
Libraries
@Chris__Bailey | Swift@IBM #swiftsummit


Swift on the Server is Real
Swift 3.0 + Kitura 1.0

@Chris__Bailey | Swift@IBM #swiftsummit
Let’s take a tour…
@Chris__Bailey | Swift@IBM #swiftsummit
Create an Application
First, create a new project directory:
$ mkdir myFirstProject
Next, create a new Swift project using the Swift Package Manager.
$ cd myFirstProject
$ swift package init —-type executable
In Package.swift, add Kitura as a dependency for your project.
import PackageDescription
let package = Package(
name: "myFirstProject",
dependencies: [
.Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 1, minor: 0)
])
@Chris__Bailey | Swift@IBM #swiftsummit
Create an Application
In Sources/main.swift, add the following code.
import Kitura
// Create a new router
let router = Router()
// Handle HTTP GET requests to /
router.get("/") {
request, response, next in
response.send("Hello, World!")
next()
}
// Add an HTTP server and connect it to the router
Kitura.addHTTPServer(onPort: 8090, with: router)
// Start the Kitura runloop (this call never returns)
Kitura.run()
@Chris__Bailey | Swift@IBM #swiftsummit
Deploy an Application
Open your browser at http://localhost:8090
Compile and run your application:
$ swift build
$ .build/debug/myFirstProject
@Chris__Bailey | Swift@IBM #swiftsummit
Demo
@Chris__Bailey | Swift@IBM #swiftsummit
Use Services
@Chris__Bailey | Swift@IBM #swiftsummit
Deploy to Cloud
$ docker pull ibmcom/kitura-ubuntu:latest $ git clone https://github.com/IBM-Swift/
Kitura-Starter-Bluemix
@Chris__Bailey | Swift@IBM #swiftsummit
Using Cloud Tools
http://cloudtools.bluemix.net
• Deployment made easy
• Clone, code, push
• Demo projects to try
@Chris__Bailey | Swift@IBM #swiftsummit
http://www.kitura.io/en/resources/tutorials.html
Tutorials
• Creating a Todo-List Backend
• Adding Authentication with Kitura-Credentials
• Adding Sessions with Kitura-Session
• Using Templating Engines with Kitura
• Enabling SSL/TLS on Kitura
• Using FastCGI with Kitura
• Special Types of Response Handlers
• Parsing Requests
@Chris__Bailey | Swift@IBM #swiftsummit
Examples
Blitter Social Network
https://github.com/ibm-swift/blitter
BluePic Application
https://github.com/ibm-swift/bluepic
@Chris__Bailey | Swift@IBM #swiftsummit
Discover Try
Build
IBM Cloud Tools
Package Catalog Swift Sandbox
Kitura + Packages
DeploySwift @ IBM
https://developer.ibm.com/swift/
@Chris__Bailey | Swift@IBM #swiftsummit
Swift
@Chris__Bailey | Swift@IBM #swiftsummit
Swift
For safer missions to Mars
@Chris__Bailey | Swift@IBM #swiftsummit

More Related Content

PDF
Why Swift on the server?
PDF
Building Cloud-agnostic Serverless APIs
PDF
Visual Recognition with Anki Cozmo and TensorFlow
PDF
Developing Serverless Applications with Apache OpenWhisk
PDF
PayPal's History of Microservices Architecture
PDF
Create Alexa Skills using IBM Watson Conversation and Apache OpenWhisk
PDF
Reactive Microservices with Quarkus
PDF
FOSDEM 2021 - Infrastructure as Code Drift & Driftctl
Why Swift on the server?
Building Cloud-agnostic Serverless APIs
Visual Recognition with Anki Cozmo and TensorFlow
Developing Serverless Applications with Apache OpenWhisk
PayPal's History of Microservices Architecture
Create Alexa Skills using IBM Watson Conversation and Apache OpenWhisk
Reactive Microservices with Quarkus
FOSDEM 2021 - Infrastructure as Code Drift & Driftctl

What's hot (18)

PPTX
Writing Slack Bots in JavaScript
PDF
AWS re:Invent "The secrets to building and delivering amazing apps at scale"
PDF
Taking Spring Apps for a Spin on Microsoft Azure Cloud
PDF
Jakarta Tech Talk: How to develop your first cloud-native Application with Java
PPTX
DevOps and AWS - Code PaLOUsa 2017
PDF
10 Steps to Cloud Happiness
PDF
NetflixOSS: The Netflix Way
PPTX
Shift Left - How to improve your security with checkov before it’s going to p...
PDF
10 things you can do at the edge
PPTX
Intro to AWS IOT
PDF
Nils Rhode - Does it always have to be k8s - TeC Day 2019
PDF
A DevOps State of Mind with Microservices, Containers and Kubernetes
PPTX
Azure labs Vinicius
PDF
Harnessing the power of aws using dot net core
PDF
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
PPTX
X-celerate 2019: Iterating fast with the MERN Stack
PPTX
AWS EKS Security Best Practices
PPTX
From Dev To Prod: How theScore deploys Elixir applications
Writing Slack Bots in JavaScript
AWS re:Invent "The secrets to building and delivering amazing apps at scale"
Taking Spring Apps for a Spin on Microsoft Azure Cloud
Jakarta Tech Talk: How to develop your first cloud-native Application with Java
DevOps and AWS - Code PaLOUsa 2017
10 Steps to Cloud Happiness
NetflixOSS: The Netflix Way
Shift Left - How to improve your security with checkov before it’s going to p...
10 things you can do at the edge
Intro to AWS IOT
Nils Rhode - Does it always have to be k8s - TeC Day 2019
A DevOps State of Mind with Microservices, Containers and Kubernetes
Azure labs Vinicius
Harnessing the power of aws using dot net core
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
X-celerate 2019: Iterating fast with the MERN Stack
AWS EKS Security Best Practices
From Dev To Prod: How theScore deploys Elixir applications
Ad

Viewers also liked (11)

PDF
Dai consigli di strada alla segreteria arancione
DOCX
Desa wuna kec. tongkuno
ODP
Activitat prova bmacris
PDF
Razestrigonomtricaslista1
PDF
Mark Sheet
PDF
INSPIRE 2nd Ed
PDF
Accesorii pentru picurare
PPTX
Evaluation part 2.
DOCX
H&S School Talk Case Study
DOCX
Tarea 12
PPTX
Data collection
Dai consigli di strada alla segreteria arancione
Desa wuna kec. tongkuno
Activitat prova bmacris
Razestrigonomtricaslista1
Mark Sheet
INSPIRE 2nd Ed
Accesorii pentru picurare
Evaluation part 2.
H&S School Talk Case Study
Tarea 12
Data collection
Ad

Similar to Pushing Swift to the Server (20)

PDF
server side Swift
PDF
Bringing swift to cloud
PDF
FrenchKit: End to End Application Development with Swift
PDF
Pushing the boundaries of Swift to the Server
PDF
SWIFTly, Go Cloud!! - Swift@IBM
PPTX
Montreal Cloud Computing Meetup - July 19
PPTX
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
PPTX
Swift at IBM: Mobile, open source and the drive to the cloud
PPTX
Mobile, Open Source, and the Drive to the Cloud
PPTX
Mobile, Open Source, & the Drive to the Cloud
PDF
Introduction to Kitura - Swift Hong Kong Meetup 2016 July
PDF
Server-side Swift with Swagger
PPTX
Swift @ IBM
PDF
The state of server-side Swift
PDF
Swift server-side-let swift2016
PDF
Swift on the Server
PDF
Try! Swift Tokyo2017
PPTX
Server Side Swift
PDF
Playgrounds: Mobile + Swift = BFF
PDF
Swift Install Workshop - OpenStack Conference Spring 2012
server side Swift
Bringing swift to cloud
FrenchKit: End to End Application Development with Swift
Pushing the boundaries of Swift to the Server
SWIFTly, Go Cloud!! - Swift@IBM
Montreal Cloud Computing Meetup - July 19
Server Side Swift with Kitura@IBM by Sangeeth K Sivakumar
Swift at IBM: Mobile, open source and the drive to the cloud
Mobile, Open Source, and the Drive to the Cloud
Mobile, Open Source, & the Drive to the Cloud
Introduction to Kitura - Swift Hong Kong Meetup 2016 July
Server-side Swift with Swagger
Swift @ IBM
The state of server-side Swift
Swift server-side-let swift2016
Swift on the Server
Try! Swift Tokyo2017
Server Side Swift
Playgrounds: Mobile + Swift = BFF
Swift Install Workshop - OpenStack Conference Spring 2012

More from ibmmobile (13)

PDF
The Disruptors: Redefining the possible, Vol. III
PDF
The Disruptors: Redefining the possible, Vol. II
PDF
Ten rules for Bring Your Own Device (BYOD)
PDF
A Swift Path to Productivity
PPTX
IBM Mobile Analyst Rankings 2016
PDF
Top 5 Insights: SXSW 2016
PDF
Can content management change your business?
PDF
IBM MobileFirst Sessions at Insight2015 - A Pocket Guide
PPT
IBM MobileFirst Technical Overview
PPT
An Overview on IBM MobileFirst Platform v7
PDF
Mobile World Congress 2015 Recap
PDF
Mobile World Congress 2015 Recap - Day Four
PDF
Mobile World Congress 2015 Recap - Day Three
The Disruptors: Redefining the possible, Vol. III
The Disruptors: Redefining the possible, Vol. II
Ten rules for Bring Your Own Device (BYOD)
A Swift Path to Productivity
IBM Mobile Analyst Rankings 2016
Top 5 Insights: SXSW 2016
Can content management change your business?
IBM MobileFirst Sessions at Insight2015 - A Pocket Guide
IBM MobileFirst Technical Overview
An Overview on IBM MobileFirst Platform v7
Mobile World Congress 2015 Recap
Mobile World Congress 2015 Recap - Day Four
Mobile World Congress 2015 Recap - Day Three

Recently uploaded (20)

PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Introduction to Artificial Intelligence
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Cost to Outsource Software Development in 2025
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
L1 - Introduction to python Backend.pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
Odoo POS Development Services by CandidRoot Solutions
Design an Analysis of Algorithms II-SECS-1021-03
Introduction to Artificial Intelligence
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
wealthsignaloriginal-com-DS-text-... (1).pdf
Odoo Companies in India – Driving Business Transformation.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Softaken Excel to vCard Converter Software.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Cost to Outsource Software Development in 2025
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
How to Choose the Right IT Partner for Your Business in Malaysia
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Operating system designcfffgfgggggggvggggggggg
L1 - Introduction to python Backend.pptx
Design an Analysis of Algorithms I-SECS-1021-03
Why Generative AI is the Future of Content, Code & Creativity?
Odoo POS Development Services by CandidRoot Solutions

Pushing Swift to the Server

  • 1. @Chris__Bailey | Swift@IBM #swiftsummit Swift @ IBM Engineering Team Chris Bailey(@Chris__Bailey) November 7th, 2016 Pushing Swift to the Server
  • 2. @Chris__Bailey | Swift@IBM #swiftsummit Why Swift on the Server?
  • 3. @Chris__Bailey | Swift@IBM #swiftsummit Performant Applications 4.0 4.3 15.8 134.2 0.0 20.0 40.0 60.0 80.0 100.0 120.0 Duration(s) (lowerisbetter) http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
  • 4. @Chris__Bailey | Swift@IBM #swiftsummit 15.0 32.2 25.3 54.6 0.0 10.0 20.0 30.0 40.0 50.0 60.0 Low Memory MemoryUsage(MB) (lowerisbetter) http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm
  • 5. @Chris__Bailey | Swift@IBM #swiftsummit Swift is ideal for Cloud
  • 6. @Chris__Bailey | Swift@IBM #swiftsummit@Chris__Bailey | Swift@IBM #swiftsummit
  • 7. @Chris__Bailey | Swift@IBM #swiftsummit MARS @Chris__Bailey | Swift@IBM #swiftsummit
  • 8. @Chris__Bailey | Swift@IBM #swiftsummit 1998 Mars Climate ORbiteR @Chris__Bailey | Swift@IBM #swiftsummit
  • 9. @Chris__Bailey | Swift@IBM #swiftsummit DeC 11: Launch from Cape Canaveral1998 Mars Climate ORbiteR @Chris__Bailey | Swift@IBM #swiftsummit
  • 10. @Chris__Bailey | Swift@IBM #swiftsummit 1998 Mars Climate ORbiteR DeC 11: Launch from Cape Canaveral @Chris__Bailey | Swift@IBM #swiftsummit
  • 11. @Chris__Bailey | Swift@IBM #swiftsummit 1999 Mars Climate ORbiteR Sept 23rd: Lost Radio Contact @Chris__Bailey | Swift@IBM #swiftsummit
  • 12. @Chris__Bailey | Swift@IBM #swiftsummit 1999 Mars Climate ORbiteR Sept 25th: Mission Declared a LOSS @Chris__Bailey | Swift@IBM #swiftsummit
  • 14. @Chris__Bailey | Swift@IBM #swiftsummit PLANNED TRAJECTORY
  • 15. @Chris__Bailey | Swift@IBM #swiftsummit PLANNED TRAJECTORY TCM-4
  • 16. @Chris__Bailey | Swift@IBM #swiftsummit PLANNED TRAJECTORY TCM-4
  • 17. @Chris__Bailey | Swift@IBM #swiftsummit PLANNED TRAJECTORY TCM-4 226 KM
  • 18. @Chris__Bailey | Swift@IBM #swiftsummit PLANNED TRAJECTORY TCM-4 ACTUAL TRAJECTORY 226 KM
  • 19. @Chris__Bailey | Swift@IBM #swiftsummit PLANNED TRAJECTORY TCM-4 ACTUAL TRAJECTORY 226 KM TCM-4
  • 20. @Chris__Bailey | Swift@IBM #swiftsummit PLANNED TRAJECTORY TCM-4 TCM-4 ACTUAL TRAJECTORY 226 KM
  • 21. @Chris__Bailey | Swift@IBM #swiftsummit PLANNED TRAJECTORY TCM-4 ACTUAL TRAJECTORY 226 KM 57 KM TCM-4
  • 22. @Chris__Bailey | Swift@IBM #swiftsummit@Chris__Bailey | Swift@IBM #swiftsummit
  • 23. @Chris__Bailey | Swift@IBM #swiftsummit Lockheed Martin
 Ground SoftwareNasa Jet Propulsion Laboratory
 Trajectory Calculation Software
  • 24. @Chris__Bailey | Swift@IBM #swiftsummit Lockheed Martin
 Ground Software Nasa Jet Propulsion Laboratory
 Trajectory Calculation Software SIS
 (Software Interface Specification) Total Impulse pounds-seconds (United States Customary Unit) newton-seconds (International System of Units) 11.488
  • 25. @Chris__Bailey | Swift@IBM #swiftsummit “Software interop is hard” @Chris__Bailey | Swift@IBM #swiftsummit
  • 26. @Chris__Bailey | Swift@IBM #swiftsummit “Software interop is hard” —Rocket Scientists @Chris__Bailey | Swift@IBM #swiftsummit
  • 27. @Chris__Bailey | Swift@IBM #swiftsummit Siloed Development API
 Specification Collaborate on API Collaborate on API Create Deploy Create Deploy
  • 28. @Chris__Bailey | Swift@IBM #swiftsummit Collaborate on Project Collaborate on Project Collaborative Development Deploy DeployGenerate API
 Specification
  • 29. @Chris__Bailey | Swift@IBM #swiftsummit Swift Development Collaborate on Swift Project Deploy DeployGenerate Swagger API
 Specification Collaborate on Swift Project
  • 30. @Chris__Bailey | Swift@IBM #swiftsummit Collaboratively Building
 Applications
  • 31. @Chris__Bailey | Swift@IBM #swiftsummit December 3rd, 2015 Apache 2.0 Software Licence Swift Everywhere
  • 32. @Chris__Bailey | Swift@IBM #swiftsummit Kitura: A Swift Web Framework and HTTP Server http://kitura.io
  • 33. @Chris__Bailey | Swift@IBM #swiftsummit Server / Cloud DeploymentServer / Cloud DeploymentApple Client Deployment Client Facing App Client-Specific Libraries Kitura Web Framework Swift Standard
 Library Foundation Dispatch Swift Standard
 Library Foundation Dispatch Networking Security HTTPParsing Application Libraries Application Specific Cloud Services Server-Specific Libraries Application Libraries Consistent Runtime across Clients/Servers Kitura-based Server! Built with Dispatch & Foundation Swift “Server” APIs Application Libraries
  • 34. @Chris__Bailey | Swift@IBM #swiftsummit 
 Swift on the Server is Real Swift 3.0 + Kitura 1.0

  • 35. @Chris__Bailey | Swift@IBM #swiftsummit Let’s take a tour…
  • 36. @Chris__Bailey | Swift@IBM #swiftsummit Create an Application First, create a new project directory: $ mkdir myFirstProject Next, create a new Swift project using the Swift Package Manager. $ cd myFirstProject $ swift package init —-type executable In Package.swift, add Kitura as a dependency for your project. import PackageDescription let package = Package( name: "myFirstProject", dependencies: [ .Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 1, minor: 0) ])
  • 37. @Chris__Bailey | Swift@IBM #swiftsummit Create an Application In Sources/main.swift, add the following code. import Kitura // Create a new router let router = Router() // Handle HTTP GET requests to / router.get("/") { request, response, next in response.send("Hello, World!") next() } // Add an HTTP server and connect it to the router Kitura.addHTTPServer(onPort: 8090, with: router) // Start the Kitura runloop (this call never returns) Kitura.run()
  • 38. @Chris__Bailey | Swift@IBM #swiftsummit Deploy an Application Open your browser at http://localhost:8090 Compile and run your application: $ swift build $ .build/debug/myFirstProject
  • 39. @Chris__Bailey | Swift@IBM #swiftsummit Demo
  • 40. @Chris__Bailey | Swift@IBM #swiftsummit Use Services
  • 41. @Chris__Bailey | Swift@IBM #swiftsummit Deploy to Cloud $ docker pull ibmcom/kitura-ubuntu:latest $ git clone https://github.com/IBM-Swift/ Kitura-Starter-Bluemix
  • 42. @Chris__Bailey | Swift@IBM #swiftsummit Using Cloud Tools http://cloudtools.bluemix.net • Deployment made easy • Clone, code, push • Demo projects to try
  • 43. @Chris__Bailey | Swift@IBM #swiftsummit http://www.kitura.io/en/resources/tutorials.html Tutorials • Creating a Todo-List Backend • Adding Authentication with Kitura-Credentials • Adding Sessions with Kitura-Session • Using Templating Engines with Kitura • Enabling SSL/TLS on Kitura • Using FastCGI with Kitura • Special Types of Response Handlers • Parsing Requests
  • 44. @Chris__Bailey | Swift@IBM #swiftsummit Examples Blitter Social Network https://github.com/ibm-swift/blitter BluePic Application https://github.com/ibm-swift/bluepic
  • 45. @Chris__Bailey | Swift@IBM #swiftsummit Discover Try Build IBM Cloud Tools Package Catalog Swift Sandbox Kitura + Packages DeploySwift @ IBM https://developer.ibm.com/swift/
  • 46. @Chris__Bailey | Swift@IBM #swiftsummit Swift
  • 47. @Chris__Bailey | Swift@IBM #swiftsummit Swift For safer missions to Mars @Chris__Bailey | Swift@IBM #swiftsummit