Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serving static files: set a default filename extension #120

Closed
fghhfg opened this issue Jun 3, 2019 · 3 comments
Closed

serving static files: set a default filename extension #120

fghhfg opened this issue Jun 3, 2019 · 3 comments

Comments

@fghhfg
Copy link

fghhfg commented Jun 3, 2019

How do I serve webpage without extension (.html)?
Or it just a bad idea without .html on my static website?

It also doesn't work on http-server of npm, let's why I'm here...

ref:
http-party/http-server#160

@75lb
Copy link
Member

75lb commented Jun 3, 2019

default extensions are not currently supported but I will fix that very soon.

I will add a new option (probably --static.extensions) that will enable you to specify a default filename extension, for example:

$ ws --static.extensions html

With this option set, if you supply a URL like /page it will look for both page and page.html on disk, serving the latter.

I'll let you know once this is fixed.

@75lb 75lb changed the title serve clean URL? serving static files: set a default filename extension Jun 3, 2019
@75lb
Copy link
Member

75lb commented Jun 3, 2019

I have fixed this and released a prerelease. Could you test it works for you?

Install the prerelease.

$ npm install -g local-web-server@next

Run ws with a default filename extension of html.

ws --static.extensions html

Let me know how it goes.

@75lb
Copy link
Member

75lb commented Jun 9, 2019

Fixed and released in v3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants