You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm halfway done in the Crossroads router+History.js implementation and I see something which seems not supported - or that I at least don't know how to do. It is to have a wildcard for the beginning of the route, or as a workaround configure a base-URL at the init stage.
Hi @olignyf
This usually isn't a problem. Routing works off the url fragment after top level domain. So if the top level domain changes it doesn't make a difference to the router. However in your application, if you want to see the full route somehow, you can use window.location.href.
Also if you inspect the state object returned from HistoryJS' adapter's getState(), you see all the URL components in it.
To test out how your router behaves with something other than localhost, you can put a host file entry pointing 127.0.0.1 to say dev.domain.local in your dev machine.
(edit the C:\windows\system32\drivers\etc\hosts file, you have to open it using elevated privileges)
Oh but my problem is not with the domain name but with the URL fragment. If you take a look at the URL provided my website can run from a subdirectory which is what is not working.
Hi,
I'm halfway done in the Crossroads router+History.js implementation and I see something which seems not supported - or that I at least don't know how to do. It is to have a wildcard for the beginning of the route, or as a workaround configure a base-URL at the init stage.
Router.addRoute('*cities/{id}', function(cityId) { (...) } });
Because in dev mode my URL can be
http://localhost/dev/sandbox/home-panel/public/
http://localhost/dev/sandbox/home-panel/public/cities/2643339
etc.
And in production
domain.com
domain.com/cities/2643339
etc.
Thanks!
The text was updated successfully, but these errors were encountered: