46
By @Cegonya @Coderpug SERVER SIDE DEVELOPMENT SWIFT + VAPOR

Server side development using Swift and Vapor

Embed Size (px)

Citation preview

By@Cegonya@Coderpug

SERVER SIDE DEVELOPMENTSWIFT + VAPOR

@cegonya @coderpug

SWIFT

“The powerful programming language

that is also easy to learn”Apple

HISTORYIntroduced at

HISTORYSwift 2.0 released at

HISTORY

Swift 2.2 was made Open Source Software on Dec 3 2015

“One of the most exciting aspects of developing Swift in the open is knowing that it is now free to be ported across a wide range of platforms, devices, and use cases”

https://swift.org

HISTORY

Open Source Software (OSS) ???

iOS macOS watchOS tvOS

SERVER

HISTORYSwift 3.0 released at

PERFORMANCE

(2014) http://www.primatelabs.com/blog/2014/12/swift-performance/

PERFORMANCE

(2016) http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=spectralnorm

SERVER-SIDE EFFORTS

Web Frameworks and HTTP Server

PERFECT VAPOR KITURA

ZEWO

MOST USED

https://github.com/paulofaria/swiftpm-packages-statistics

BENCHMARK

https://medium.com/@qutheory/server-side-swift-vs-the-other-guys-2-speed-ca65b2f79505#.vh4uy8mqh

BENCHMARK

https://medium.com/@qutheory/server-side-swift-vs-the-other-guys-2-speed-ca65b2f79505#.vh4uy8mqh

BENCHMARK

https://medium.com/@qutheory/server-side-swift-vs-the-other-guys-2-speed-ca65b2f79505#.vh4uy8mqh

SWIFT SERVER APIs WORK GROUP

https://swift.org/server-apis/

VAPOR

MODULES

ENGINE

MODULES

https://github.com/vapor/engine

STRUCTURE

PROJECT

. ├── Sources │ └── App │ └── Controllers │ └── Middleware │ └── Models │ └── main.swift ├── Public ├── Resources │ └── Views └── Package.swift

ROUTING

PROJECT

Standard HTTP methods GET/POST/PUT/DELETE and more.

Basic : Method + Path + Closure

VIEWS/Leaf

PROJECT

Template framework

Token-based #

MODULES

MODULES

CONFIGURATION

Requirements : Xcode 8+ with Swift 3+

Vapor toolbox :Install

curl -sL toolbox.vapor.sh | bash

ENVIRONMENT SETUP

ENVIRONMENT SETUP

vapor xcode

ENVIRONMENT SETUP

Create a base template project

From the project folder

vapor new Hello

ENVIRONMENT SETUP

READY 4 PRODUCTION?

NOT YET!

SWIFT 3 does NOT have ABI Compatibility

Web Frameworks < 1 yo

Server = Maturity

?

@NSCoderMDZ

@NSCoderBA

http://nsconfarg.com/