-
Notifications
You must be signed in to change notification settings - Fork 70
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
index.html as default file in subfolders? #19
Comments
This doesn't really fit into the single page app server ethos. You should really only have one index.html file at the root of your project and load in components from there. |
Ah, right. This is for SPA. I used servor for single-page apps and just continued to use it for regular plain old websites, didn't even think twice. 😄 |
Do you know any no-dependency projects that has livereload and ssl that isn't "only" for SPA? I've kinda hacked |
Hey man 👋 I do not.. but we could surface this issue again and put the behaviour behind a flag potentially. Like What does your hack look like? |
also swimming by to say this was rather unintuitive for me. using servor through svelvet, and it wasn't obvious that this was ONLY for SPAs. i kept refreshing thinking something was wrong. expected there to be a config to serve any existing html files. so i guess count this as a "+1" haha. usecase - making a svelte site generator, need this for local dev mode if you'll take a PR and/or give some specs i can try to PR - but also totally cool if you just want to keep it focused on the SPA usecase. my plan would be to add a flag, say edit: hang on... are we just slowly replicating sirv? help me get my head straight here i'm confused how they differ now apart from the zero dep/SPA only thing here |
So the only reason I was conflicted about this in the first place was that if someone making a SPA visited route Initially I thought this might be confusing but now that everything is behind a flag, users would only experience this new In summary, you all make good points and it shouldn't be too hard to implement. Let me have a quick play around with the code.. see whats what!
The zero dependency thing has been a draw for some people as it makes install very fast (arguably only ~2s faster than sirv to There is also a slight difference in feature set:
That said.. I'm sure lukeed could implement all of these features in a hot minute if he wanted to. Maybe he made sirv for a slightly different purpose to servor 🤷♂ his stuff is always 💯 |
Alright.. so I have this working but there is one issue I can't get around which you might be able to help me with. Here you can see that with the new flag But it doesn't.. it goes for |
Ahh.. so it seems to work if I add this to the document head: <base href="/nested/" /> Is this how you would expect it to work? I highly doubt that one would want to have to prefix all the resources in the document with I wonder if es module imports respect base like this 🤔 |
this is surprising to me too. i went ahead and tested it on netlify.
so it seems that on the web, i wouldnt recommend mucking around with |
Hummm.. I wonder what it is then. I googled pretty extensively and didn't find much! |
This is now possible in V4 (#51) with the
I welcome any further feedback if anyone has experience/opinions on this! 🙇 |
wheee! |
Currently, when I open something like
localhost:8080/path
, I get the fallback/index.html
file instead of an existing file/path/index.html
. Most servers, including GitHub pages, are by default configured "smartly" and return the index.html file (if it exists) when a folder is requested. Would be nice for this to be configurable, or maybe even default?The text was updated successfully, but these errors were encountered: