When creating the SammyJS application, simply pass window.location.pathname
to the run()
method as follows:
Sammy(function () {
this.get(/* custom route */, function (context) {
// ... handle navigation ...
});
}).run(window.location.pathname); // Voila!