Vapor Documentation

Structure Middlewares

public struct Middlewares  

Configures an application's active Middleware. Middleware will be used in the order they are added.

Nested Types

Middlewares.Position

Initializers

init()

public init()  

Create a new, empty Middleware.

Methods

use(_:​at:​)

public mutating func use(_ middleware: Middleware, at position: Position = .end)  

Adds a pre-initialized Middleware instance.

app.middleware.use(fooMiddleware)

resolve()

public func resolve() -> [Middleware]  

Resolves the configured middleware for a given container