"/" ignores dispatch rules #5

lostcolony opened this Issue Dec 20, 2012 · 2 comments


None yet

2 participants


From playing around with this (very cool btw), I noticed that if I attempted to launch my app from a directory other than where index.html resides, "/" would fail to be resolved, whereas if I specified "/index.html" it would be resolved fine.

This appears to be caused due to ezwebframe:handle/2, the logic is different when resolving "/" than any other page. This may be intentional (it makes sense to launch from wherever index.html is located after all), but it is surprising to see -

mapped to:"/location/where/index/is/for/realsies/located"
*** no page called "index.html"

when hitting "/", and have it load just fine when hitting "/index.html".


I hadn't noticed this - I'll have to take a look, I'd always run the program directly with a top-level make ...

@lostcolony lostcolony closed this Dec 20, 2012
@lostcolony lostcolony reopened this Dec 20, 2012

Whoops. Came to look, clicked the wrong button. :P Was going to comment, the top level makefile then runs the makefile in /demos, which executes erl, and that is also where index.html is.

If erl is launched somewhere other than where index.html lives, even if the dispatcher knows to point to that location properly (I had erl executing from /ebin, but a /web folder as a sort of catch-all for client side things, and that was where index.html was), that information is ignored due to the different logic for resolving "/". But "/index.html" worked fine, since that didn't match "/", and instead fell to the _ case clause, which passes in the Env#env.dispatch path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment