Given a route id or url and a set of meta data, build returns a route request object or false if the route is not found. see Route Request Object
Property Name | Type | Description |
---|---|---|
params | Object | The params needed to generate the route request object. |
method | String | The HTTP method that the request should be invoked with. Used for matching routes |
query | Object | Additional query properties to add to the query string |
var router = fluxapp.getRouter();
fluxapp.registerRoute({
id : 6,
path : '/route/with/:end?very=cool',
handler: _.noop
});
var routeRequest = router.build(6, {
params: {
end: 'query'
},
query: {
cool: 'indeed'
}
});
routeRequest.url // /route/with/query?very=cool&cool=indeed