If you want to scare an iOS developer, just start talking about server side programming. I often get comments on my courses where students always lean towards Firebase or similar solutions. As a developer who started with backend more than a decade ago, I cannot emphasize it enough, how important is backend programming.
In this article, I will go over how to get started with Vapor framework and how you can start building your backend in your favorite language, Swift.
Vapor is a server side framework for Swift developers. This means you can use your beloved Swift language on the server to create Web APIs or even server side pages using Leaf template engine.
To get started with Vapor, you need to install brew. Brew is a package manager, which can be installed by following instructions.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
After you have install Brew, you need to install Vapor. You can follow the instructions on the Vapor docs to install the latest version of Vapor.
Vapor: Install → macOS
To use Vapor on macOS, you will need Swift 5.2 or greater. Swift and all of its dependencies come bundled with Xcode…
To check if you have installed Vapor successfully, open the terminal on your Mac and type the command “vapor-beta — help” (two dashes). At the time of this article Vapor was still in release candidate. Once Vapor will be released to public, vapor-beta command will be change to vapor.
Looks like Vapor has been installed successfully. Next step is to create a new Vapor project. This can be accomplished by running the following command.
vapor-beta new hello-vapor
vapor-beta is the terminal command. The keyword new implies that we are creating a new project and hello-vapor is the name of the project. At some point the command line tool will ask you if you want to also use Fluent. Type n for no and…