Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antoniofregoso/bj-router
Lightweight router in vanilla javascript for the BuyerJourneyJS project
https://github.com/antoniofregoso/bj-router
router vanilla-javascript
Last synced: 14 days ago
JSON representation
Lightweight router in vanilla javascript for the BuyerJourneyJS project
- Host: GitHub
- URL: https://github.com/antoniofregoso/bj-router
- Owner: antoniofregoso
- License: gpl-3.0
- Created: 2024-02-07T23:38:57.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-05-18T05:52:32.000Z (7 months ago)
- Last Synced: 2024-12-03T04:18:19.394Z (22 days ago)
- Topics: router, vanilla-javascript
- Language: JavaScript
- Homepage: https://buyerjourney.ninja/router
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bj-router
Lightweight Router in vanilla javascript for the BuyerJourneyJS project.## Sponsors
[](https://www.conference.com.mx/comercializacion-digital)## Features
- Multiple routes with path and callback function.
- Single page application routing using hash.
- Parameters.
- Query strings.
- Set name on routes with setName(name) and retrieve the path with pathFor(name, parameters).
- Error 404: Callback function included.
- Error 404: Customizable Callback function.## Example
```javascript
import { bjRouter } from "@buyerjourney/router";
import { home, store, blog } from "./app/pages";App = new bjRouter({ hashSensitive:true});
App.on('/', home);
App.on('#store/{product}', store);
App.on('#blog/{article}', blog);App.run();
```## Documentation
- [BuyerJourneyJS project](https://buyerjourney.ninja/).
- [bj-router](https://buyerjourney.ninja/router).
- [Get started](https://buyerjourney.ninja/get-started).## License
bj-router is [GPL-3.0-or-later](./LICENSE).