Route Object

The route object consists of the following properties;

📘

Not Found Routes

Multiple not found routes can be registered, the one that matches and has the deepest path will be used.

Not found routes are all suffixed with a catchall, so registering both / and /admin is possible.

NameRequiredTypeDescription
idYesStringThe id of the route, used in getRouteById method
notFoundNoBooleanWhether or not this route is responsible for display 404 not found pages.
pathYesUnless registering a global not found routeStringuse the route-parser module.
handlerYesFunctionThe handler to be called when the route is matched.
loaderYesIf the handler option has a load property it will be usedFunctionSee loaders for more information
methodNoStringThe http method that this route should match, if omitted the route will match any method.
👍