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

Getting Started with Swift Web Frameworks

Getting Started with Swift Web Frameworks

Now that Swift is open-source and cross-platform, several teams are racing to make Swift a viable language for web development. The major frameworks: Perfect, Vapor, IBM Kitura, and Zewo have over 22,000 stars on GitHub, and are growing quickly!

Learn about the evolution of Swift, the different web frameworks, and an introduction for how to get started with developing in server side Swift. Join Edward for a live coding demo and even deploy a Swift application to the cloud!

Presented at All Things Open 2016
https://allthingsopen.org

Perfect: https://perfect.org
Vapor: https://vapor.codes
Kitura: http://kitura.io
Zewo: http://zewo.io

Turnstile Auth for server-side Swift: https://github.com/stormpath/Turnstile

Follow me on Twitter: https://twitter.com/edwardstarcraft

Edward Jiang

October 26, 2016
Tweet

More Decks by Edward Jiang

Other Decks in Programming

Transcript

  1. “For the second year in a row Rust, Swift and

    Go make the top 5 most loved programming languages.”
  2. Install Swift Version Manager $ git clone https://github.com/kylef/swiftenv.git ~/.swiftenv $

    echo 'export SWIFTENV_ROOT="$HOME/.swiftenv"' >> ~/.bash_profile $ echo 'export PATH="$SWIFTENV_ROOT/bin:$PATH"' >> ~/.bash_profile $ echo 'eval "$(swiftenv init -)"' >> ~/.bash_profile
  3. Initialize Your Project $ mkdir HelloWorld $ cd HelloWorld $

    swift package init --type executable Creating executable package: HelloWorld Creating Package.swift Creating Sources/ Creating Sources/main.swift Creating Tests/
  4. Add Vapor to your Package.swift import PackageDescription let package =

    Package( name: "HelloWorld", dependencies: [ .Package(url: "https://github.com/ vapor/vapor.git", majorVersion: 1) ] )
  5. Now…to deploy to the web! $ git init $ heroku

    create $ heroku buildpacks:set https:// github.com/kylef/heroku-buildpack-swift $ echo 'web: HelloWorld -- config:servers.default.port=$PORT' >> Procfile $ git add . $ git commit -m "created project" $ git push heroku master