title: How to implement Plain JS router that listens for typed pathname changes in Address bar like react?
body: <p>I have created a Vanilla Javascript SPA, which has a basic router function. I am currently able to change URL thru pushstate event, and store previous pages in an object array in a stack like way allowing users to goBack() to previous pages. My challenge is if i statically type the Route in Address Bar e.g "localhost/Home", I receive a "GET error /Home" as the browser makes request to Server for the page. I have used React Router before and was able type the desired route in Address Bar and page loaded(Without-Server). How does react solve this issue in a pure javascript way without a server. Im thinking of some way of intercepting URL_change_event before the page reloads, then match the pathname to some pre-defined route, stopping the browser from reloading and display desired page.
  How can I solve this issue? Thanks in advance.</p>