Routes let you point specific URIs to specific controllers.


Adds (registers) new routes (one or more)
Arguments: [object] routes
'/articles': 'articleList',
'/articles/([a-z]+)': 'article',
'/articles/([a-z]+)/comments': 'comments'
The keys in the object you pass to this function are treated as URI patterns that are matched to the URI. You can use regular expressions in these patterns. The corresponding values in the object reflect the controller names that the URIs are routed to.
For example, if you define a key "/articles/([a-z]+)" and point it to "article" controller, it means that all URIs that match to that pattern get routed to "article" controller.
(Note: The "article" controller can then perhaps ask for the second segment of the URI to see which article was asked - this is something that might be improved in next versions to allow capturing variables from the regular expression patterns).


Removes a routes (one at a time)
Arguments: [string] route