Thanks to visit codestin.com
Credit goes to github.com

Skip to content

antoniofregoso/cj-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cj-router

Lightweight Router in vanilla javascript for the BuyerJourneyJS project.

CustumerJourney.js

This library is part of the CustumerJourney.js project. Vanilla JavaScript libraries optimized for creating sales funnels with hyper-personalized customer experience powered by artificial intelligence.

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

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

License

cj-router is GPL-3.0-or-later.

Sponsor

Become a CustumerJourney.js Sponsor.

About

Lightweight router in vanilla javascript for the CustomerJourneyJS project

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published