HttpRoute

HttpRoute

HttpRoute

Constructor

new HttpRoute(url, route) → {HttpRoute}

HttpRoute class provides routing functionality to HTTP requests
Parameters:
Name Type Description
url String A formatted string that represents the HTTP route request url (e.g. /pages/:name, /user/:id/edit etc).
route String A formatted string that represents the HTTP route response url (e.g. /pages/:name.html, /user/edit.html).
Source:
Returns:
Type
HttpRoute

Methods

data(key)

Gets a route data value based on the given key. If key does not exist returns null.
Parameters:
Name Type Description
key String
Source:

format() → {String}

Source:
Returns:
Type
String

isMatch(url)

Parameters:
Name Type Description
url String
Source:
Returns:
Boolean

parse(url)

Parameters:
Name Type Description
url String
Source: