swipely / aviator

Aviator is a single-page front-end router built for modularity.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Initial route

ouhouhsami opened this issue · comments

Hello,

Aviator works fine for me, just got a problem to handle initial url.
When I run 'http://127.0.0.1/', and then use navigate to /foo, it's ok, but when I directly access, for instance, http://127.0.0.1/foo (loading this url) I get a 404. How can you get rid of that using Aviator ?

Cheers

Sounds like your server is returning a 404? To use pushState you need to allow all urls to return the same original markup (or pre render things on the server), so that Aviator can pick up the url. If you don't want to use pushState or don't have control over the server in that way you can disable push state and your urls would be like this instead: "http://127.0.0.1/#/foo"

Hope this makes sense - pushState can be a little wonky to work with

@ouhouhsami closing this issue. Let me know if my previous comment resolved your issue or not.

Well, thanks for your cristal clear answer.