muut/riotjs — pull request #111 by 3den (2014-06-24 19:12:48+00:00)
Title: Super Powerful Routes 

This PR introduces a huge improvement in our routes making it easy to define different callbacks for each path. Below I am adding some examples, check the tests for more details.

```javascript
// Defining several routes at once
riot.route({
// static route
"/home": function(params) { ... },

// RegEx route
".*/something": function(params) { ... },

// Passing params
"/items/{item}": function(params) { ... },

// With RegEx and several params
".*/{type}/{id}?.*q={q}.*": function(params) { ... }
})

// Defining a single route
riot.route("/somepage", function(params) { ... });

// Trigger a route, this will execute the the callback of this route
riot.route("/somepage");
```