I need something like this
app.get("*", callback)
so every request url will be redirected to index.html.
but since this package not using express, I don't know how to solve this.
See #30, #306, #271 and #123. They all seem to be bundled in #80.
gonna read it then, thanks a lot :)
I'm not sure, #80 doesn't provide any clear answer,
I think all I need to do is just modifying some lines here: https://github.com/indexzero/http-server/blob/master/lib/http-server.js
But turns out, it probably more complex than that?
I'm not sure, #80 doesn't provide any clear answer,
No, it is the proposal for this feature.
-P http://localhost:8080/? worked for me. Note the question mark at the end.
The -P http://localhost:8080? method is rather brilliant, and I think that may be the answer here, since your index.html is essentially acting as the proxy for all other pages.
@thornjad let's get this added to the README.
Sending 200 OK is an anti-HTTP pattern. While SPA's may "benefit" from it, it's bad architecture both generally and for deployed SPAs and should really only be used in development and not production. Even the Angular docs suggest it shouldn't be used permanently because it's bad for both UX and performance.
However, having it handy for development does help folks who are doing HTML and not HTTP, so solving it at the README layer sounds great. :smiley:
Most helpful comment
-P http://localhost:8080/? worked for me. Note the question mark at the end.