Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"/" ignores dispatch rules #5

Open
lostcolony opened this issue Dec 20, 2012 · 2 comments
Open

"/" ignores dispatch rules #5

lostcolony opened this issue Dec 20, 2012 · 2 comments

Comments

@lostcolony
Copy link

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"
serve_abs:"index.html"
*** no page called "index.html"

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

@joearms
Copy link
Owner

joearms commented Dec 20, 2012

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
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants