#
Setup
You're viewing documentation for a previous version of this software. Switch to the latest stable version
In this guide, we will be using Graphiti and setting up Vapor from scratch without using any template.
#
Prerequisites
Obviously, Pioneer requires Swift installed. Swift can be installed for most operation systems, just follow the official guide from swift.org
#
Application
Setup the skeleton of the executable using Swift package manager by running:
swift package init --type executable
#
Dependencies
Next, add all three main dependencies: Vapor, Graphiti and of course, Pioneer to your Package.swift
.
import PackageDescription
let package = Package(
dependencies: [
.package(url: "https://github.com/GraphQLSwift/Graphiti.git", from: "1.0.0"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.61.1"),
.package(url: "https://github.com/d-exclaimation/pioneer", from: "0.10.0")
],
targets: [
.target(
name: "...",
dependencies: [
.product(name: "Pioneer", package: "pioneer"),
.product(name: "Graphiti", package: "Graphiti"),
.product(name: "Vapor", package: "vapor")
]
)
]
)
Swift 5.5 toolchain
Pioneer require Swift 5.5 or up due to the _Concurrency
package and features it relies on.
let package = Package(
platforms: [
.macOS(.v12)
],
)
At least until Xcode 13.2 is fully fleshed out, where these features are being brought to older versions as well.
#
Basic application
Let's continue with setting up the basic Vapor application.
Go to your main.swift
, add Vapor, and setup a simple Vapor application with no routing or any other configuration.
import Vapor
let app = try Application(.detect())
defer {
app.shutdown()
}
try app.run()