Skip to content

Instance Method

route(path:parameters:)

Routes a path, returning the best-matching output and collecting any dynamic parameters.
func route(path: [String], parameters: inout Parameters) -> Output?

Parameters

path

Raw path segments.

parameters

Will collect dynamic parameter values.

Return Value

Output of matching route, if found.

Discussion

var params = Parameters()
router.route(path: ["users", "Vapor"], parameters: &params)