preactjs / preact-router

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

Allow optional host for matching #376

Open Meisolsson opened 4 years ago

Meisolsson commented 4 years ago

Hi,

We ran into case where we would like preact-router to handle complete URL:s. For example we get a link like https://example.com/test from our CMS and when the user clicks it we would prefer if Preact handled that but it should not handle https://other-site.com/test. I propose a prop on the router which can be checked against like:

<Router host={'https://example.com'}>
   ...
</Router>