Coder Social home page Coder Social logo

Comments (11)

leo avatar leo commented on June 17, 2024 1

If you're site generator doesn't do it like that, it simply should: #58 (comment) 😊

from serve.

timneutkens avatar timneutkens commented on June 17, 2024

Isn't this what -s, --single is for? On second though, nevermind.

from serve.

flybayer avatar flybayer commented on June 17, 2024

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.

timneutkens avatar timneutkens commented on June 17, 2024

You're right I was too quick 😉

from serve.

leo avatar leo commented on June 17, 2024

Doesn't site.com/history serve history/index.html?

from serve.

flybayer avatar flybayer commented on June 17, 2024

@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.

joshgillies avatar joshgillies commented on June 17, 2024

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.

flybayer avatar flybayer commented on June 17, 2024

That's a possibility, but I'm sure someone else will come along and want this behavior for some other use case 🙂

from serve.

flybayer avatar flybayer commented on June 17, 2024

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.

joshgillies avatar joshgillies commented on June 17, 2024

@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.

flybayer avatar flybayer commented on June 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.