-
A typealias for the underlying storage type.
Declaration
Swift
public typealias DictionaryType = [Request.Method : [Route]]
-
A path prefix for
Route
s.Declaration
Swift
public private(set) var path: String { get }
-
A name prefix for
Route
s.Declaration
Swift
public private(set) var name: String { get }
-
A read-only array of registered
Middleware
.Declaration
Swift
public let middleware: [Middleware]
-
Initializes a new instance with the defaults.
Declaration
Swift
public init()
-
Initializes a new instance.
Warning
It may returnnil
if the path prefix is invalid.Declaration
Swift
public init?( _ routes: RouteCollection = .init(), path: String = Route.defaultPath, name: String = "", middleware: [Middleware] = .init() )
Parameters
routes
An instance of
RouteCollection
.path
A path prefix to a resource. Defaults to
Route.defaultPath
.name
A name prefix for
Route
s. Defaults to an empty string.middleware
An array of registered
Middleware
. Defaults to an empty array. -
Initializes a new instance with another
RouteCollection
.Declaration
Swift
public convenience init(_ routes: RouteCollection)
Parameters
routes
An instance of
RouteCollection
. -
Initializes a new instance with a name prefix.
Declaration
Swift
public convenience init(name: String)
Parameters
name
A name prefix for
Route
s. -
Initializes a new instance.
Warning
It may returnnil
if the path prefix is invalid.Declaration
-
Helps to build a tree of
See moreRouteCollection
s withRoute
s.Declaration
Swift
open class Builder
-
Inserts
Route
s from anotherRouteCollection
.Declaration
Swift
public func insert(_ routes: RouteCollection)
Parameters
routes
An instance of
RouteCollection
. -
See
Collection
.Declaration
Swift
public typealias Index = DictionaryType.Index
-
See
Collection
.Declaration
Swift
public typealias Element = DictionaryType.Element
-
See
Collection
.Declaration
Swift
public var startIndex: Index { get }
-
See
Collection
.Declaration
Swift
public var endIndex: Index { get }