Comments (11)
Perhaps unrelated but it would be nice to specify an explicit fallback page (i.e. ./index.html
) to support almost-static single page applications that change the URL using pushState. I could see that this is outside the scope of your project though...
The issue with using a default 404 page is that the server will still return an error status code in the HTTP response. Since I'm just using http-server
as a simple documentation viewer... it's not a big deal.
from http-server.
This works unless you use the -P / --proxy
flag.
Single page apps can just symlink index.html -> 404.html and everything works. The server will still respond with a 404 code, but that shouldn't matter in most use cases.
from http-server.
👍 I want to load my single page application if the file does not exist on the filesystem
from http-server.
We don't use node-static
anymore. Is this possible with ecstatic
now @jesusabdullah? I read the code but it wasn't totally obvious to me at a quick skim.
from http-server.
yes, ecstatic does this, and has for some time.
from http-server.
Ok, going to reopen this because we need to expose it through the http-server
CLI. Is there an example of how to use this functionality in ecstatic
? The option is really illuding me when reading the source.
from http-server.
@jesusabdullah specifically I am talking about custom 404 pages. Maybe that wasn't what you meant when you opened this issue.
from http-server.
It's automatic, unless handleError is turned off.
from http-server.
@cmwelsh realize this is a 6 months later, but 👍! Actually was looking at the repo today to see if this was a planned feature. I love this little server, but I can't use it for my SPA's with "html5mode" on for this reason.
from http-server.
any progress on this?
from http-server.
The 404.html
file thing has been handled by node-ecstatic for awhile now. I've added a note about it to the README
9571d0a to close this issue.
Thanks, all!
from http-server.
Related Issues (20)
- Do you have plans to support multipart/byteranges HOT 1
- Fails to serve Unity/Brotli HOT 2
- Static File Directory flag HOT 1
- 404 error on the page with param HOT 2
- index.html change but doesn't have any auto refreshing must to manual refresh HOT 4
- Proxy target request header not present HOT 1
- Bug Report HOT 1
- Do not open a new browser window if one is already open HOT 1
- RangeError: Invalid time value HOT 3
- --cors usage is incorrect in the documentation HOT 1
- How to let the json file (*.json) return response header: 'application/json', instead of 'application/json; charset=UTF-8' HOT 1
- OWASP vulnerability in dependency tree HOT 1
- i use it with termux,but i do not know how to upload file to termux HOT 1
- http-server runing on project root folder path without any reasons HOT 2
- {"message":"You are not authorized"} in GitHub Codespace HOT 2
- Support relative path prefixes (base in vite.config.js) HOT 2
- Need a maintainer? HOT 9
- Link not opening in Browser
- Add bandwidth limit parameter HOT 1
- Option -c is not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-server.