Structure
APICollection
public struct APICollection
Order for defining routing.
It was defined as a specification when ordering routing from the presentation layer to the domain layer.
Note
If possible, I wanted to define this class as an abstract order that does not depend on the framework, but I gave up it because it was difficult in Vapor.
Initializers
init(method:paths:closure:middlewares:)
public init(method: HTTPMethodInDomain,
paths: [PathComponent],
closure: @escaping (Request) throws -> Future<Response>,
middlewares: [Middleware] = [])
Default initializer.
Parameters
Name | Type | Description |
---|---|---|
method | HTTPMethodInDomain |
HTTPMethod to which API responds. |
paths | [PathComponent] |
See |
closure | @escaping (Request) throws -> Future<Response> |
API processing. |
middlewares | [Middleware] |
Middleware that performs processing between Framework and Controller. |
Properties
middlewares
public let middlewares: [Middleware]
Middleware that performs processing between Framework and Controller.