-
Notifications
You must be signed in to change notification settings - Fork 58
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
How to best serve sub folders and files? #9
Comments
Ah, that's interesting. As you've surmised, I don't think there's currently a good way to do this. What I have in mind is an router-level option to never do the trailing slash redirect for paths with a catch-all at the end. I might actually make that the default behavior, since the current behavior in this case doesn't really make much sense, and I suspect there isn't anyone depending on it working how it does now. I should be able to get this to you by next week, but maybe earlier. Hope that works :) |
That's totally fine. Thanks for taking this on :) |
Ended up with a bit of time so I implemented this. Thanks for all your feedback! |
Wow, you're fast! This works as imagined. Thank you! |
Hi,
I'd like to serve everything that is present in folder called
pages
. Here's a sample structure:Here's what I'm doing with httptreemux:
This works fine when I open e. g.
http://server.url/pages/webgl/Release/fileloader.js
.However,
http.ServeFile
is supposed to serve theindex.html
when openinghttp://server.url/pages/webgl/
.It does that, but the path will be rewritten to the one without a trailing slash (
http://server.url/pages/webgl
).This breaks links to files and sub folders in the
index.html
, e.g.:which will now link to
http://server.url/pages/Release/fileloader.js
instead ofhttp://server.url/pages/webgl/Release/fileloader.js
.Thanks
Kai
The text was updated successfully, but these errors were encountered: