Router
public class Router
The Router
class provides the external interface for the routing of requests to
the appropriate code for handling. This includes:
- Routing requests to closures with the signature of
RouterHandler
- Routing requests to the handle function of classes that implement the
RouterMiddleware
protocol. - Routing the request to a template engine to generate the appropriate output.
- Serving the landing page when someone makes an HTTP request with a path of slash (/).
-
The root directory for templates that will be automatically handed over to an appropriate templating engine for content generation.
Declaration
Swift
public var viewsPath = "./Views/"
-
Initialize a
Router
instanceDeclaration
Swift
public init()
-
Sets the default templating engine to be used when the extension of a file in the
viewsPath
doesn’t match the extension of one of the registered templating engines.Parameter
Parameter templateEngine: The new default templating engineDeclaration
Swift
public func setDefault(templateEngine: TemplateEngine?)
Parameters
templateEngine
The new default templating engine
-
Register a templating engine. The templating engine will handle files in the
viewsPath
that match the extension it supports.Parameter
Parameter templateEngine: The templating engine to register.Declaration
Swift
public func add(templateEngine: TemplateEngine)
Parameters
templateEngine
The templating engine to register.
-
Setup a
sub router
to handle requests. This can make it easier to build a server that serves a large set of paths, by breaking it up in tosub router
where each sub router is mapped to it’s own root path and handles all of the mappings of paths below that.Parameter
Parameter route: The path to bind the sub router to.
Returns
The created sub router.
Declaration
Swift
public func route(_ route: String) -> Router
Parameters
route
The path to bind the sub router to.
Return Value
The created sub router.
-
Handle an HTTP request as a middleware. Used for sub routing.
Parameter
Parameter request: TheRouterRequest
object that is used to work with the incoming request.Parameter
Parameter response: TheRouterResponse
object used to send responses to the HTTP request.Parameter
Parameter next: The closure to invoke to cause the router to inspect the path in the list of paths.Declaration
Swift
public func handle(request: RouterRequest, response: RouterResponse, next: @escaping () -> Void) throws
Parameters
request
The
RouterRequest
object that is used to work with the incoming request.response
The
RouterResponse
object used to send responses to the HTTP request.next
The closure to invoke to cause the router to inspect the path in the list of paths.
-
Handle the HTTP request
Parameter
Parameter request: TheServerRequest
object used to work with the incoming HTTP request at the Kitura-net API level.Parameter
Parameter response: TheServerResponse
object used to send responses to the HTTP request at the Kitura-net API level.Declaration
Swift
public func handle(request: ServerRequest, response: ServerResponse)
Parameters
request
The
ServerRequest
object used to work with the incoming HTTP request at the Kitura-net API level.response
The
ServerResponse
object used to send responses to the HTTP request at the Kitura-net API level.
-
Setup error handling that will cause a set of one or more closures of the type
RouterHandler
to be invoked when an error occurs.Parameter
Parameter handler: A comma delimited set ofRouterHandler
that will be invoked if an error ocurrs.Declaration
Swift
public func error(_ handler: @escaping RouterHandler...) -> Router
Parameters
handler
A comma delimited set of
RouterHandler
that will be invoked if an error ocurrs. -
Setup error handling that will cause an array of one or more closures of the type
RouterHandler
to be invoked when an error occurs.Parameter
Parameter handler: An array ofRouterHandler
that will be invoked if an error ocurrs.Declaration
Swift
public func error(_ handler: [RouterHandler]) -> Router
Parameters
handler
An array of
RouterHandler
that will be invoked if an error ocurrs. -
Setup error handling that will cause a set of one or more
RouterMiddleware
to be invoked when an error occurs.Parameter
Parameter middleware: A comma delimited set ofRouterMiddleware
that will be invoked if an error ocurrs.Declaration
Swift
public func error(_ middleware: RouterMiddleware...) -> Router
Parameters
middleware
A comma delimited set of
RouterMiddleware
that will be invoked if an error ocurrs. -
Setup error handling that will cause an array of one or more
RouterMiddleware
to be invoked when an error occurs.Parameter
Parameter middleware: An array ofRouterMiddleware
that will be invoked if an error ocurrs.Declaration
Swift
public func error(_ middleware: [RouterMiddleware]) -> Router
Parameters
middleware
An array of
RouterMiddleware
that will be invoked if an error ocurrs.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when any request comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when any request comes to the server.Declaration
Swift
public func all(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when any request comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when any request comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when any request comes to the server.Declaration
Swift
public func all(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when any request comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when any request comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when any request comes to the server.Declaration
Swift
public func all(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when any request comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when any request comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when any request comes to the server.Declaration
Swift
public func all(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when any request comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP GET requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP GET requests comes to the server.Declaration
Swift
public func get(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP GET requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP GET requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP GET requests comes to the server.Declaration
Swift
public func get(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP GET requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP GET requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP GET requests comes to the server.Declaration
Swift
public func get(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP GET requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP GET requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP GET requests comes to the server.Declaration
Swift
public func get(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP GET requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP HEAD requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP HEAD requests comes to the server.Declaration
Swift
public func head(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP HEAD requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP HEAD requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP HEAD requests comes to the server.Declaration
Swift
public func head(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP HEAD requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP HEAD requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP HEAD requests comes to the server.Declaration
Swift
public func head(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP HEAD requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP HEAD requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP HEAD requests comes to the server.Declaration
Swift
public func head(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP HEAD requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP POST requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP POST requests comes to the server.Declaration
Swift
public func post(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP POST requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP POST requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP POST requests comes to the server.Declaration
Swift
public func post(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP POST requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP POST requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP POST requests comes to the server.Declaration
Swift
public func post(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP POST requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP POST requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP POST requests comes to the server.Declaration
Swift
public func post(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP POST requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP PUT requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP PUT requests comes to the server.Declaration
Swift
public func put(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP PUT requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP PUT requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP PUT requests comes to the server.Declaration
Swift
public func put(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP PUT requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP PUT requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP PUT requests comes to the server.Declaration
Swift
public func put(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP PUT requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP PUT requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP PUT requests comes to the server.Declaration
Swift
public func put(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP PUT requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP DELETE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP DELETE requests comes to the server.Declaration
Swift
public func delete(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP DELETE requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP DELETE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP DELETE requests comes to the server.Declaration
Swift
public func delete(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP DELETE requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP DELETE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP DELETE requests comes to the server.Declaration
Swift
public func delete(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP DELETE requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP DELETE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP DELETE requests comes to the server.Declaration
Swift
public func delete(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP DELETE requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP OPTIONS requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP OPTIONS requests comes to the server.Declaration
Swift
public func options(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP OPTIONS requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP OPTIONS requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP OPTIONS requests comes to the server.Declaration
Swift
public func options(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP OPTIONS requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP OPTIONS requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP OPTIONS requests comes to the server.Declaration
Swift
public func options(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP OPTIONS requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP OPTIONS requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP OPTIONS requests comes to the server.Declaration
Swift
public func options(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP OPTIONS requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP TRACE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP TRACE requests comes to the server.Declaration
Swift
public func trace(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP TRACE requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP TRACE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP TRACE requests comes to the server.Declaration
Swift
public func trace(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP TRACE requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP TRACE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP TRACE requests comes to the server.Declaration
Swift
public func trace(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP TRACE requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP TRACE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP TRACE requests comes to the server.Declaration
Swift
public func trace(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP TRACE requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP COPY requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP COPY requests comes to the server.Declaration
Swift
public func copy(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP COPY requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP COPY requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP COPY requests comes to the server.Declaration
Swift
public func copy(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP COPY requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP COPY requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP COPY requests comes to the server.Declaration
Swift
public func copy(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP COPY requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP COPY requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP COPY requests comes to the server.Declaration
Swift
public func copy(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP COPY requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP LOCK requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP LOCK requests comes to the server.Declaration
Swift
public func lock(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP LOCK requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP LOCK requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP LOCK requests comes to the server.Declaration
Swift
public func lock(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP LOCK requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP LOCK requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP LOCK requests comes to the server.Declaration
Swift
public func lock(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP LOCK requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP LOCK requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP LOCK requests comes to the server.Declaration
Swift
public func lock(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP LOCK requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP MKCOL requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP MKCOL requests comes to the server.Declaration
Swift
public func mkCol(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP MKCOL requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP MKCOL requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP MKCOL requests comes to the server.Declaration
Swift
public func mkCol(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP MKCOL requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP MKCOL requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP MKCOL requests comes to the server.Declaration
Swift
public func mkCol(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP MKCOL requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP MKCOL requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP MKCOL requests comes to the server.Declaration
Swift
public func mkCol(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP MKCOL requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP MOVE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP MOVE requests comes to the server.Declaration
Swift
public func move(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP MOVE requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP MOVE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP MOVE requests comes to the server.Declaration
Swift
public func move(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP MOVE requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP MOVE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP MOVE requests comes to the server.Declaration
Swift
public func move(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP MOVE requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP MOVE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP MOVE requests comes to the server.Declaration
Swift
public func move(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP MOVE requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP PURGE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP PURGE requests comes to the server.Declaration
Swift
public func purge(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP PURGE requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP PURGE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP PURGE requests comes to the server.Declaration
Swift
public func purge(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP PURGE requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP PURGE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP PURGE requests comes to the server.Declaration
Swift
public func purge(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP PURGE requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP PURGE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP PURGE requests comes to the server.Declaration
Swift
public func purge(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP PURGE requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP PROPFIND requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP PROPFIND requests comes to the server.Declaration
Swift
public func propFind(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP PROPFIND requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP PROPFIND requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP PROPFIND requests comes to the server.Declaration
Swift
public func propFind(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP PROPFIND requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP PROPFIND requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP PROPFIND requests comes to the server.Declaration
Swift
public func propFind(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP PROPFIND requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP PROPFIND requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP PROPFIND requests comes to the server.Declaration
Swift
public func propFind(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP PROPFIND requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP PROPPATCH requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP PROPPATCH requests comes to the server.Declaration
Swift
public func propPatch(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP PROPPATCH requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP PROPPATCH requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP PROPPATCH requests comes to the server.Declaration
Swift
public func propPatch(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP PROPPATCH requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP PROPPATCH requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP PROPPATCH requests comes to the server.Declaration
Swift
public func propPatch(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP PROPPATCH requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP PROPPATCH requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP PROPPATCH requests comes to the server.Declaration
Swift
public func propPatch(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP PROPPATCH requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP UNLOCK requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP UNLOCK requests comes to the server.Declaration
Swift
public func unlock(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP UNLOCK requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP UNLOCK requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP UNLOCK requests comes to the server.Declaration
Swift
public func unlock(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP UNLOCK requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP UNLOCK requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP UNLOCK requests comes to the server.Declaration
Swift
public func unlock(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP UNLOCK requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP UNLOCK requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP UNLOCK requests comes to the server.Declaration
Swift
public func unlock(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP UNLOCK requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP REPORT requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP REPORT requests comes to the server.Declaration
Swift
public func report(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP REPORT requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP REPORT requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP REPORT requests comes to the server.Declaration
Swift
public func report(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP REPORT requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP REPORT requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP REPORT requests comes to the server.Declaration
Swift
public func report(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP REPORT requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP REPORT requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP REPORT requests comes to the server.Declaration
Swift
public func report(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP REPORT requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP MKACTIVITY requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP MKACTIVITY requests comes to the server.Declaration
Swift
public func mkActivity(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP MKACTIVITY requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP MKACTIVITY requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP MKACTIVITY requests comes to the server.Declaration
Swift
public func mkActivity(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP MKACTIVITY requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP MKACTIVITY requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP MKACTIVITY requests comes to the server.Declaration
Swift
public func mkActivity(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP MKACTIVITY requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP MKACTIVITY requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP MKACTIVITY requests comes to the server.Declaration
Swift
public func mkActivity(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP MKACTIVITY requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP CHECKOUT requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP CHECKOUT requests comes to the server.Declaration
Swift
public func checkout(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP CHECKOUT requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP CHECKOUT requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP CHECKOUT requests comes to the server.Declaration
Swift
public func checkout(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP CHECKOUT requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP CHECKOUT requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP CHECKOUT requests comes to the server.Declaration
Swift
public func checkout(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP CHECKOUT requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP CHECKOUT requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP CHECKOUT requests comes to the server.Declaration
Swift
public func checkout(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP CHECKOUT requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP MERGE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP MERGE requests comes to the server.Declaration
Swift
public func merge(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP MERGE requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP MERGE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP MERGE requests comes to the server.Declaration
Swift
public func merge(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP MERGE requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP MERGE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP MERGE requests comes to the server.Declaration
Swift
public func merge(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP MERGE requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP MERGE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP MERGE requests comes to the server.Declaration
Swift
public func merge(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP MERGE requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP MSEARCH requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP MSEARCH requests comes to the server.Declaration
Swift
public func mSearch(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP MSEARCH requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP MSEARCH requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP MSEARCH requests comes to the server.Declaration
Swift
public func mSearch(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP MSEARCH requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP MSEARCH requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP MSEARCH requests comes to the server.Declaration
Swift
public func mSearch(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP MSEARCH requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP MSEARCH requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP MSEARCH requests comes to the server.Declaration
Swift
public func mSearch(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP MSEARCH requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP NOTIFY requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP NOTIFY requests comes to the server.Declaration
Swift
public func notify(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP NOTIFY requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP NOTIFY requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP NOTIFY requests comes to the server.Declaration
Swift
public func notify(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP NOTIFY requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP NOTIFY requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP NOTIFY requests comes to the server.Declaration
Swift
public func notify(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP NOTIFY requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP NOTIFY requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP NOTIFY requests comes to the server.Declaration
Swift
public func notify(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP NOTIFY requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP SUBSCRIBE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP SUBSCRIBE requests comes to the server.Declaration
Swift
public func subscribe(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP SUBSCRIBE requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP SUBSCRIBE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP SUBSCRIBE requests comes to the server.Declaration
Swift
public func subscribe(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP SUBSCRIBE requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP SUBSCRIBE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP SUBSCRIBE requests comes to the server.Declaration
Swift
public func subscribe(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP SUBSCRIBE requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP SUBSCRIBE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP SUBSCRIBE requests comes to the server.Declaration
Swift
public func subscribe(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP SUBSCRIBE requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP UNSUBSCRIBE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP UNSUBSCRIBE requests comes to the server.Declaration
Swift
public func unsubscribe(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP UNSUBSCRIBE requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP UNSUBSCRIBE requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP UNSUBSCRIBE requests comes to the server.Declaration
Swift
public func unsubscribe(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP UNSUBSCRIBE requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP UNSUBSCRIBE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP UNSUBSCRIBE requests comes to the server.Declaration
Swift
public func unsubscribe(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP UNSUBSCRIBE requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP UNSUBSCRIBE requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP UNSUBSCRIBE requests comes to the server.Declaration
Swift
public func unsubscribe(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP UNSUBSCRIBE requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP PATCH requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP PATCH requests comes to the server.Declaration
Swift
public func patch(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP PATCH requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP PATCH requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP PATCH requests comes to the server.Declaration
Swift
public func patch(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP PATCH requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP PATCH requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP PATCH requests comes to the server.Declaration
Swift
public func patch(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP PATCH requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP PATCH requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP PATCH requests comes to the server.Declaration
Swift
public func patch(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP PATCH requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP SEARCH requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP SEARCH requests comes to the server.Declaration
Swift
public func search(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP SEARCH requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP SEARCH requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP SEARCH requests comes to the server.Declaration
Swift
public func search(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP SEARCH requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP SEARCH requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP SEARCH requests comes to the server.Declaration
Swift
public func search(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP SEARCH requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP SEARCH requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP SEARCH requests comes to the server.Declaration
Swift
public func search(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP SEARCH requests comes to the server.
-
Setup a set of one or more closures of the type
RouterHandler
that will be invoked when HTTP CONNECT requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: A comma delimited set ofRouterHandler
s that will be invoked when HTTP CONNECT requests comes to the server.Declaration
Swift
public func connect(_ path: String?=nil, handler: @escaping RouterHandler...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
A comma delimited set of
RouterHandler
s that will be invoked when HTTP CONNECT requests comes to the server. -
Setup an array of one or more closures of the type
RouterHandler
that will be invoked when HTTP CONNECT requests comes to the server. If a path pattern is specified, the handlers will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.Parameter
Parameter handler: The array ofRouterHandler
s that will be invoked when HTTP CONNECT requests comes to the server.Declaration
Swift
public func connect(_ path: String?=nil, handler: [RouterHandler]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the handlers to be invoked.
handler
The array of
RouterHandler
s that will be invoked when HTTP CONNECT requests comes to the server. -
Setup a set of one or more
RouterMiddleware
that will be invoked when HTTP CONNECT requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: A comma delimited set ofRouterMiddleware
that will be invoked when HTTP CONNECT requests comes to the server.Declaration
Swift
public func connect(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: RouterMiddleware...) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
A comma delimited set of
RouterMiddleware
that will be invoked when HTTP CONNECT requests comes to the server. -
Setup an array of one or more
RouterMiddleware
that will be invoked when HTTP CONNECT requests comes to the server. If a path pattern is specified, theRouterMiddleware
will only be invoked if the pattern is matched.Parameter
Parameter path: An optional String specifying the pattern that needs to be matched, in order for theRouterMiddleware
to be invoked.Parameter
Parameter allowPartialMatch: A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.Parameter
Parameter handler: The array ofRouterMiddleware
that will be invoked when HTTP CONNECT requests comes to the server.Declaration
Swift
public func connect(_ path: String?=nil, allowPartialMatch: Bool = true, middleware: [RouterMiddleware]) -> Router
Parameters
path
An optional String specifying the pattern that needs to be matched, in order for the
RouterMiddleware
to be invoked.allowPartialMatch
A Bool that indicates whether or not a partial match of the path by the pattern is sufficient.
handler
The array of
RouterMiddleware
that will be invoked when HTTP CONNECT requests comes to the server.