Hashbang/Shebang support
andreas-wagner opened this issue · 1 comments
andreas-wagner commented
Hi, what do I have to do to let rlite handle hashbang routes?
chrisdavies commented
If you look at the readme, you'll see this snippet:
// Hash-based routing
function processHash() {
const hash = location.hash || '#';
// Do something useful with the result of the route
document.body.textContent = route(hash.slice(1));
}
Just change the slice to take off 2 chars instead of one:
document.body.textContent = route(hash.slice(2));