chrisdavies/rlite

Hashbang/Shebang support

andreas-wagner opened this issue · 1 comments

Hi, what do I have to do to let rlite handle hashbang routes?

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));