Using configRoutes.js

ConfigRoutes.js was removed from Jaxer with 0.9.8, it's functionality has been encapsulated within configApps.js

Jaxer provides a mechanism to identify an application by it's URL structure, this is controlled by the 'configRoutes.js' configuration script.

The Jaxer global routing object (Jaxer.Config.routes) holds an array of javascript functions that return either a NULL, if the url doesn't match the rule, or, a 2 value array, if the url matches the rule, the first value is the identifier for the application and the second value is the identifier for the page. These identifiers are used to manage script access to the Jaxer application and page containers.

The example above would create two applications predicated on the folder structure, the first,the ToyStore application, would be active for any pages server from the myApps/toys folder, the second from the myApps/books folder. These would have an application identifer (Jaxer.application.key) of 'ToyStore' and 'Bookstore' respectively, with each page being identified by it's full URL.

In the event that a URL doesn't match any of the provided rules, the default Jaxer rules would apply which provides an application name based on the fullpath to the folder, and a page context based on the full path to the document being served.