« Back
Sammy.Application route ( verb, path, callback )
route() is the main method for defining routes within an application.
For great detail on routes, check out:
http://sammyjs.org/docs/routes
This method also has aliases for each of the different verbs (eg. get(), post(), etc.)
Arguments
verbA String in the set of ROUTE_VERBS or 'any'. 'any' will add routes for each of the ROUTE_VERBS. If only two arguments are passed, the first argument is the path, the second is the callback and the verb is assumed to be 'any'.pathA Regexp or a String representing the path to match to invoke this verb.callbackA Function that is called/evaluated whent the route is run see:runRoute(). It is also possible to pass a string as the callback, which is looked up as the name of a method on the application.
comments powered by Disqus