After you have installed Vapor and understand its basic principles, let's install the API template to get started. Run the following command:
$ vapor new FirstApp
This command is telling Vapor to download the most recent version of their API starter template. It's a preconfigured set of files that are a good starting point for API applications. Follow the given steps:
- Switch into the folder that contains FirstApp by typing the following:
$ cd FirstApp
- Now, let's create an Xcode project:
$ open Package.swift
- The preceding command will open the project for you automatically. You will now see the project and the structure you have learned about.
- To run a Vapor application in Xcode you must make sure that you are running the "Run" target. It might default to another one. To run correclty it should look like this:
That's all for...