Learn how to install Vapor in a local macOS environment.
- [Narrator] When installing Vapor, you can choose to install it either on Mac OS or Obuntu. Both are relatively easy to do and in this video, we're going to demonstrate how to install it on Mac OS. The first step is to make sure you have Swift installed on your machine. For Obuntu users, you can install Swift by performing the following curl command. That's curl -sL swift.vapor.sh/obuntu | bash.
For Mac OS users, you just need to make sure that you have Xcode 8 or later installed. You must open Xcode at least once to allow it to finish its install before you can install Vapor. Doing it so will install the latest components and ensure that the development environment is fully set up. Now to verify that Swift is properly installed on your machine, you can run the following command. We're going to say curl -sL check.vapor.sh | bash.
I'm going to go ahead and run it. And if everything checks out, we're going to get a check mark stating that our system is compatible. And only when I can do this is when I'll know that it's safe for me to install Vapor. Now to install the Vapor tool box, we're going to curl the following script. We're going to say curl -sL toolbox.vapor.sh | bash. Again, you need to make sure you have Swift 3 installed or else this part is going to fail.
Now when I do this, it's going to install the tool box and it can take some time. So we're going to let this process run without interruption. Now once Vapor is completed, it's going to let you know that Vapor, and the version number, has been installed. Now you can verify that it's running on your system by typing vapor --help and what it'll do is it'll show you the usage and it'll let you know that you currently have Vapor installed. Know that you can always update Vapor by using its self updating mechanism by running vapor self update and if I do that, it's going to try to update my existing installation of the Vapor framework.
Okay, so now that we have Vapor installed, let's move on to creating our first Vapor project.
- Reviewing the concept of server-side Swift
- Installing Vapor in a local environment
- Creating a new Vapor project
- Reviewing Vapor's built-in capabilities to interact with external services
- Registering and authenticating with the Dark Sky API
- Working with Leaf templates
- Setting up a Heroku account
- Using common troubleshooting techniques