web-client-router
Express style client router for single page web apps
NOTE: The intent is to only support IE9+
Usage
Uses ExpressJs style routing on the client side. See Routing Path Match Rules
1. path = '/' // matches /
2. path = '/about' // matches /about
3. path = '/ab?cd' // matches abcd, abbcd, abbbcd, and so on
$ npm install web-client-router --savevar Router = ; // Create the routervar router = ; // Start the routerrouterstart; // Go to a path// @opts {Object} - optional// opts.replace = true --> to replace history state instead of push state// opts.refresh = true --> to refresh the browser window instead of using client routing// opts.skip = true --> skip all middleware and routing, just push state, so browswers url is changed. Can be used in conjunction with opts.replacerouter
More things
// You can also listen to eventsrouterevents; routerevents; routerevents; routerevents; routerevents; routerevents; routerevents; // You can also add a route later onrouter;