http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Trailing slash when serving directory index.html

Open luaVolk opened this issue 6 years ago • 6 comments

As the title says when the server adds a slash at the end when serving an index.html file from a directory besides the root.

I don't see an option to remove them and its a bit of a problem for me right now, as I'm using this as a development server and the target server does not have trailing slashes.

luaVolk avatar Jun 07 '19 21:06 luaVolk

I just have the same problem.

Macyrate avatar Nov 07 '19 04:11 Macyrate

I think you may be looking for the option -i false (autoIndex). Does using that option do what you'd like to happen?

thornjad avatar Nov 11 '19 14:11 thornjad

@thornjad unfortunately not. I get a trailing slash on my paths and this breaks the react SPA :\

damianobarbati avatar Mar 16 '20 16:03 damianobarbati

@damianobarbati have exact same issue, it prevents me from using http-server with my Vue/Nuxt app https://github.com/http-party/http-server/issues/656

simplenotezy avatar Sep 26 '20 00:09 simplenotezy

What exactly happens when you use -i false?

I'll also note that http-server is a static server and doesn't officially support SPA's, but I'm more than willing to help if I can

thornjad avatar Jul 13 '21 14:07 thornjad

This issue has been inactive for 180 days

github-actions[bot] avatar Jan 10 '22 12:01 github-actions[bot]