Allow route objects to be extented w/ custom data
Flag to indicate if this route should be passed to the globally configured authentication function. Only matched and validated routes are processed.
Array of path components. If a value is prefixed with ?
this path component will be captured under that name. E.g. ["projects", "?id"]
will match any of these routes:
projects/123
projects/abcde
validate
options can then be used to further restrict the possible value range of the id
value...
Optional route title (passed to RouteMatch)
This object specifies coercions and validators for variable / parameterized path components, e.g.
{
id: {
coerce: (x) => parseInt(x,10),
validate: (x)=> x < 100
}
}
This will first coerce the id
route param to a number and then only allow the route to be matched if id < 100
.
Generated using TypeDoc
A Route describes an application path (possibly parameterized), incl. parameter coercion, validation and overall route authentication. Apart from
id
andmatch
all other fields are optional.