-
Notifications
You must be signed in to change notification settings - Fork 8
sublimate(in:use:)
mxcl edited this page Oct 23, 2020
·
5 revisions
Creates a sublimate routable for a route that returns Vapor.Response
@_disfavoredOverload public func sublimate(in options: CO₂DB.RouteOptions? = nil, use closure: @escaping (CO₂) throws -> Response) -> (Request) throws -> EventLoopFuture<Response>
let route = sublimate { rq in
Vapor.Response(status: .ok)
}
app.routes.get(use: route)
- in: Provide
.transaction
to have this route contained in a database transaction.
Creates a sublimate routable for a route that returns NIOHTTP1.HTTPResponseStatus
public func sublimate(in options: CO₂DB.RouteOptions? = nil, use closure: @escaping (CO₂) throws -> Void) -> (Request) throws -> EventLoopFuture<HTTPResponseStatus>
let route = sublimate { rq in
NIOHTTP1.HTTPResponseStatus.ok
}
app.routes.get(use: route)
- in: Provide
.transaction
to have this route contained in a database transaction.
Creates an authenticated sublimate routable for a route that returns Vapor.Response
@_disfavoredOverload public func sublimate<User: Authenticatable>(in options: CO₂DB.RouteOptions? = nil, use closure: @escaping (CO₂, User) throws -> Response) -> (Request) throws -> EventLoopFuture<Response>
- in: Provide
.transaction
to have this route contained in a database transaction.
Creates a sublimate routable for a route that returns ResponseEncodable
@_disfavoredOverload public func sublimate<E: ResponseEncodable>(in options: CO₂DB.RouteOptions? = nil, use closure: @escaping (CO₂) throws -> E) -> (Request) throws -> EventLoopFuture<Response>
- in: Provide
.transaction
to have this route contained in a database transaction.
Creates an authenticated sublimate routable for a route that returns ResponseEncodable
@_disfavoredOverload public func sublimate<E: ResponseEncodable, User: Authenticatable>(in options: CO₂DB.RouteOptions? = nil, use closure: @escaping (CO₂, User) throws -> E) -> (Request) throws -> EventLoopFuture<Response>
- in: Provide
.transaction
to have this route contained in a database transaction.
Creates an authenticated sublimate routable for a route that returns Void
public func sublimate<User: Authenticatable>(in options: CO₂DB.RouteOptions? = nil, use closure: @escaping (CO₂, User) throws -> Void) -> (Request) throws -> EventLoopFuture<HTTPResponseStatus>
- in: Provide
.transaction
to have this route contained in a database transaction.
Generated at 2020-12-15T20:31:16+0000 using swift-doc 1.0.0-beta.5.