Roun
A hash base route library ( < 3KB
)
Example
On browser
<script src="roun.js"></script><script> var route = ; route; route; route; route; route; // // or // // route // .on('/', function () {...}) // .on('/foo/:id/bar/:name', function (data) {...}) // .on('/foo/bar/:id', function (data) {...}) // .on('/404', function () {...}) // .exec();</script>
With browserify
const roun = ;;
browserify xxx.js -o bundle.js
With webpack
const roun = ;;
webpack xxx.js bundle.js
With rollup
;;
rollup xxxx.js -o bundle.js -f umd -n xxx
Options
name | description | example | default
:----------- | :--------------------------------- | :------------------------ |
notFoundPath | Redirect path, when undefined path | /404
| '/404'
hashBase | Hash type | #
and #!
and the like | #