HttpRoute

public struct HttpRoute

An HTTP route represents a set of URL routing paths. Essentially, a set of routing paths can simply be represented by an array of strings. However, this entity enables initializing HTTP routes without having to explicitly convert all path components to String.

  • Initializes a new HTTP route.

    Declaration

    Swift

    public init(_ paths: [Any])

    Parameters

    parameters

    The HTTP routing paths. All paths are converted to strings using the String.init(describing:) initializer.

  • Combines the routing paths of two HTTP routes by appending the paths of the latter route to the paths of the former route.

    Declaration

    Swift

    public static func + (lhs: HttpRoute, rhs: HttpRoute) -> HttpRoute