Skip to content

Instantly share code, notes, and snippets.

@SwiftyAlex
Last active September 22, 2019 16:30
Show Gist options
  • Save SwiftyAlex/4e57599b178ae9b27283d1481fb9c482 to your computer and use it in GitHub Desktop.
Save SwiftyAlex/4e57599b178ae9b27283d1481fb9c482 to your computer and use it in GitHub Desktop.
A Route that gets a Todo
/// A route that gets a single `Todo`.
public struct GetTodoRoute: Route {
public typealias RequestType = Empty
public typealias ResponseType = Todo
public static let method = HTTPMethod.get
public static let path = "todos"
public static let requiresAuth = false
public var requestObject: Empty?
public var queryParemeters: [URLQueryItem] = []
public var pathParameters: [String] {
get { return [String(todo.id)] }
}
var todo: Todo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment