Class: Route

Route


new Route(path, handler)

Route class.
Parameters:
Name Type Description
path string | RegExp | function
handler function

Members


<protected, non-null> handler :function

Defines the handler which will execute once a URL in the application matches the path.
Type:
  • function

<protected> path :string|RegExp|function

Defines the path which will trigger the route handler.
Type:
  • string | RegExp | function

Methods


getHandler()

Gets the route handler.
Returns:
Type
function

getPath()

Gets the route path.
Returns:
Type
string | RegExp | function

matchesPath(value)

Matches if the router can handle the tested path.
Parameters:
Name Type Description
value string Path to test and may contains the querystring part.
Returns:
Returns true if matches any route.
Type
Boolean