routeur
Super tiny clientside static url router
npm i routeur
Usage
; ;; const routes = '/': indexAction '/page/': {console} pageAction '/page2/index.html': {console} pageAction '/page.html': {console} pageAction { console; }; const router = routes; router;
API
.configure(config)
.run(pathname = location.pathname)
.addRoute(pathname[or route object], action)
.removeRoute(pathname)
Contributing
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request :D
License
© sugarshin