-
Notifications
You must be signed in to change notification settings - Fork 0
Home
_gt3 edited this page Jul 17, 2017
·
5 revisions
Welcome to the ultra-router wiki!
String representation of a route or part of it. For example: "/new-cars/:year/:make/:model"
- identifier: Part of a path key whose value is derived dynamically from the url. Useful in matching multiple urls or validating urls. For e.g. ":year"
- literal: Part of a path key that always produces the same match - everything but identifiers in a path key.
An object that identifies a route with one or more path keys, and an action to invoke on match.
Path keys in a spec will be evaluated from left to right. Path key at position 0 is known as primary path key. Primary path key must match succesfully for remaining path keys to be considered for matching.
A spec will either resolve or reject the request to match. No more than one spec can resolve during a match.
-
resolve:
next
orerr
will be called to resolve an exact match or a partial match, respectively.next
is required, and will be used iferr
is not provided. -
reject:
failure
, if provided, will be called if the spec did not resolve. Reject is issued after resolve.
Provides API methods for a specific route configuration, invoked at runtime by the container. match
, prefixMatch
, and toggle
produce a matcher.