delete(_:use:)
RoutesBuilder+Concurrency.swift:96@discardableResult @preconcurrency func delete<Response>(_ path: PathComponent..., use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func delete<Response>(_ path: PathComponent..., use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
s5Vapor13RoutesBuilderPAAE6delete_3useAA5RouteC10RoutingKit13PathComponentOd_qd__AA7RequestCYaKctAA22AsyncResponseEncodableRd__lF
What are these?36KEX
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
protocol RoutesBuilder
enum PathComponent
A single path component of a Route
. An array of these components describes a route’s path, including which parts are constant and which parts are dynamic.
final class Request
Represents an HTTP request in an application.
final class Route
protocol AsyncResponseEncodable
Can convert self
to a Response
.
@discardableResult @preconcurrency func delete<Response>(_ path: PathComponent..., use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func delete<Response>(_ path: [PathComponent], use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func delete<Response>(_ path: [PathComponent], use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func get<Response>(_ path: PathComponent..., use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func get<Response>(_ path: PathComponent..., use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func get<Response>(_ path: [PathComponent], use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func get<Response>(_ path: [PathComponent], use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
func group(_ path: PathComponent..., configure: (RoutesBuilder) throws -> ()) rethrows
Creates a new Router
that will automatically prepend the supplied path components.
func group(_ middleware: Middleware..., configure: (RoutesBuilder) throws -> ()) rethrows
Creates a new Router
wrapped in the supplied variadic Middleware
.
func group(_ path: [PathComponent], configure: (RoutesBuilder) throws -> ()) rethrows
Creates a new Router
that will automatically prepend the supplied path components.
func group(_ middleware: [Middleware], configure: (RoutesBuilder) throws -> ()) rethrows
Creates a new Router
wrapped in the supplied array of Middleware
.
func grouped(_ path: PathComponent...) -> RoutesBuilder
Creates a new Router
that will automatically prepend the supplied path components.
func grouped(_ middleware: Middleware...) -> RoutesBuilder
Creates a new Router
wrapped in the supplied variadic Middleware
.
func grouped(_ path: [PathComponent]) -> RoutesBuilder
Creates a new Router
that will automatically prepend the supplied path components.
func grouped(_ middleware: [Middleware]) -> RoutesBuilder
Creates a new Router
wrapped in the supplied array of Middleware
.
@discardableResult @preconcurrency func on<Response>(_ method: HTTPMethod, _ path: PathComponent..., body: HTTPBodyStreamStrategy = .collect, use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func on<Response>(_ method: HTTPMethod, _ path: PathComponent..., body: HTTPBodyStreamStrategy = .collect, use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func on<Response>(_ method: HTTPMethod, _ path: [PathComponent], body: HTTPBodyStreamStrategy = .collect, use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func on<Response>(_ method: HTTPMethod, _ path: [PathComponent], body: HTTPBodyStreamStrategy = .collect, use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func patch<Response>(_ path: PathComponent..., use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func patch<Response>(_ path: PathComponent..., use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func patch<Response>(_ path: [PathComponent], use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func patch<Response>(_ path: [PathComponent], use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func post<Response>(_ path: PathComponent..., use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func post<Response>(_ path: PathComponent..., use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func post<Response>(_ path: [PathComponent], use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func post<Response>(_ path: [PathComponent], use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func put<Response>(_ path: PathComponent..., use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func put<Response>(_ path: PathComponent..., use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
@discardableResult @preconcurrency func put<Response>(_ path: [PathComponent], use closure: @escaping (Request) throws -> Response) -> Route where Response : ResponseEncodable
@discardableResult @preconcurrency func put<Response>(_ path: [PathComponent], use closure: @escaping (Request) async throws -> Response) -> Route where Response : AsyncResponseEncodable
func register(collection: RouteCollection) throws
Registers all of the routes in the group to this router.
func responseCompression(_ override: HTTPHeaders.ResponseCompression, force shouldForce: Bool = false) -> RoutesBuilder
Override the response compression settings for a route.
@discardableResult @preconcurrency func webSocket(_ path: PathComponent..., maxFrameSize: WebSocketMaxFrameSize = .`default`, shouldUpgrade: @escaping ((Request) -> EventLoopFuture<HTTPHeaders?>) = {
$0.eventLoop.makeSucceededFuture([:])
}, onUpgrade: @escaping (Request, WebSocket) -> ()) -> Route
Adds a route for opening a web socket connection
@discardableResult @preconcurrency func webSocket(_ path: PathComponent..., maxFrameSize: WebSocketMaxFrameSize = .`default`, shouldUpgrade: @escaping ((Request) async throws -> HTTPHeaders?) = { _ in [:] }, onUpgrade: @escaping (Request, WebSocket) async -> ()) -> Route
Adds a route for opening a web socket connection
@discardableResult @preconcurrency func webSocket(_ path: [PathComponent], maxFrameSize: WebSocketMaxFrameSize = .`default`, shouldUpgrade: @escaping ((Request) -> EventLoopFuture<HTTPHeaders?>) = {
$0.eventLoop.makeSucceededFuture([:])
}, onUpgrade: @escaping (Request, WebSocket) -> ()) -> Route
Adds a route for opening a web socket connection
@discardableResult @preconcurrency func webSocket(_ path: [PathComponent], maxFrameSize: WebSocketMaxFrameSize = .`default`, shouldUpgrade: @escaping ((Request) async throws -> HTTPHeaders?) = { _ in [:] }, onUpgrade: @escaping (Request, WebSocket) async -> ()) -> Route
Adds a route for opening a web socket connection