preactjs / preact-router

:earth_americas: URL router for Preact.
http://npm.im/preact-router
MIT License
1.01k stars 156 forks source link

Allow to set a custom prefix? #396

Closed staeff777 closed 3 years ago

staeff777 commented 3 years ago

Sometimes it would be useful to have single page applications that don't require a server configuration and that can run from any possible location. For this use, as far as I know, it would be necessary to use a hash prefix like "page.html#!/site". I used it sucessfully with mithril ( https://mithril.js.org/route.html#routing-strategies ).

In my opinion, this would also make sense in the preact router. Do you agree?

rschristian commented 3 years ago

Sorry for the late response, but you can use history to create a hash router like you'd want. We outline how in our ReadMe: https://github.com/preactjs/preact-router#custom-history

staeff777 commented 3 years ago

Thanks. For some reason I didn't find it.