URLMatcher

public class URLMatcher<Route> where Route : RouteType

Represents a list of URL mappings for a set of paths on some host(s)/scheme(s).

Methods

  • Match some host

    Declaration

    Swift

    public static func host(_ host: String, _ mapPathsClosure: (URLPathMapper<Route>) -> Void) -> URLMatcher
  • Match some scheme

    Declaration

    Swift

    public static func scheme(_ scheme: String, _ mapPathsClosure: (URLPathMapper<Route>) -> Void) -> URLMatcher
  • Set a group of mapped paths for some hosts/schemes.

    Declaration

    Swift

    public static func group(hosts: StringMatcher = .any,
                             schemes: StringMatcher = .any,
                             _ mapPathsClosure: (URLPathMapper<Route>) -> Void) -> URLMatcher