Comments (11)
If you're site generator doesn't do it like that, it simply should: #58 (comment) 😊
from serve.
Isn't this what -s, --single
is for? On second though, nevermind.
from serve.
As far as can tell --single
redirects all requests to index.html
. So a request to site.com/history
will be served index.html
. I want history.html
to be served in this case.
from serve.
You're right I was too quick 😉
from serve.
Doesn't site.com/history
serve history/index.html
?
from serve.
@leo, yes, that's my workaround. But I want site.com/history
to serve history.html
if it's there because that's what react-snapshot
generates for me. My workaround is a custom script that moves history.html
to history/index.html
(and likewise every other page on the site) after my build.
from serve.
As react-snapshot
is geared toward deployments to https://surge.sh, shouldn't this be a feature request against react-snapshot
? Unless, of course @leo sees value in making list
behave in the above manner?
from serve.
That's a possibility, but I'm sure someone else will come along and want this behavior for some other use case 🙂
from serve.
For list
to be the go-to solution for static file hosting, I think it needs to be flexible and have a great out of the box experience. Many other static file servers like http-server
already support this by default.
Can anyone think of a reason this feature shouldn't be added? The only thing I've thought of is we'd have to decide which should have the priority, history.html
or history/index.html
, in the case both are present.
from serve.
@flybayer if http-server
already offers support for your use case, what brought you to list
?
Personally, I feel as though a "great out of the box experience" comes from the promise that a project does what it claims to do, and does it well. With the addition of dynamic mapping between /about
and one of the following /about || /about/index.html || /about.html || /index.html
is a little too far removed from the core of what list
is about. Especially when you consider the list
tagline is:
Single-command HTTP directory listing and file serving
Heck, it could even be argued that an option to enable single page app mode is too far... ¯_(ツ)_/¯
Unless, of course the end goal of list
is to be all things to everyone, and in which case, as you were. 😄
from serve.
You have a good point @joshgillies 😄
Leo is why I switched to list
because he basically said if you want to serve static files with now
, you should use list
. It turns out, list
is significantly faster than http-server
plus list
also gzips the assets.
It definitely feels like there's a disconnect between the current tag line and @leo's latest advice. Maybe it's time for a tag line update? 🤔
from serve.
Related Issues (20)
- CORS missing Access-Control-Allow-Methods
- Remove auto redirect
- Set server timezone to UTC
- Directory or file name with "#" or "?" does not work properly
- Do not serve hidden subfolders
- Restore silent mode HOT 2
- `npx serve` throws ENOENT error in [email protected] and newer HOT 1
- serve 14.2.1 CLI arguments issue http to https
- Testing local deployments for GitHub pages doesn't work since no `basePath` can be set HOT 6
- Add cleanUrls option to CLI interface
- IPV6 support
- Publish types for API with npm release
- Node.js 21: "[DEP0040] DeprecationWarning: The `punycode` module is deprecated." HOT 4
- serve didn't work in routing with react-router and vite in production HOT 1
- add --open to the CLI
- Anyway to run npx serve constantly? HOT 3
- `localhost:1234/foo/index.html.html` provokes a 404
- Add a file size limit to etag SHA calculations, fallback to "Last modified" when above this limit.
- Authentication is not available HOT 1
- Node.js 22: "[DEP0040] DeprecationWarning: The `punycode` module is deprecated." HOT 1
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 serve.