canjs / can-route

Observable front-end application routing for CanJS.
https://canjs.com/doc/can-route.html
MIT License
10 stars 4 forks source link

route.start should warn when there is a data/route mismatch #157

Open m-mujica opened 6 years ago

m-mujica commented 6 years ago

In a sample app, I had the following routes:

route.register("/", { moduleId: "component-1" });
route.register("/component-2", { moduleId: "component-2" });

and the browser assets where located in a public folder...

when I loaded http://127.0.0.1:8080/public/ in the browser, can-route would redirect me to http://127.0.0.1:8080/ because of the route mismatch.

I was missing route.bindings.pushstate.root = "/public/", we could possibly warn the user that they might need to set the root property.

cc: @justinbmeyer