Http-server: wasm does not need charset and does not work on firefox chrome

Created on 27 Mar 2020  路  7Comments  路  Source: http-party/http-server

https://www.youtube.com/watch?v=n6hIa-fPx0M&t=618s

whole google episode about your server :)

ecstatic mime minor

Most helpful comment

for people (like me) looking for a drop in replacement for this that serves wasm files correctly, but also handles extensions nicely (as this does), npx serve is a fine replacement, as is npx local-web-server (theres a commandline option for setting default extension). these both fit all the needs I had for http-server, before I started needing to serve wasm, and they seem to serve wasm files with the correct content type.

es-dev-server will give a 404 if you omit the .html in file names (which differs from http-server and there does not appear to be a commandline arg to change it) and is also very slow. I don't know what it's doing but it takes a solid several seconds to quit after a ctrl-c (or multiple) and is just generally slow to use.

All 7 comments

Huh, that's pretty cool. Thanks for linking that, it definitely shouldn't have charset!

@thornjad in general every binary file does not have a charset. charset is for text file formats.

Finally had some time to investigate this, and this is actually coming from a dependency, ecstatic. I'm currently working on removing that dependency, and will be able to fix this after that.

@thornjad you should consider express static as a replacement that is maintained.

I've switched to local-web-server as a workaround for now.

npm i local-web-server --global
ws

@RobLoach
https://open-wc.org/developing/es-dev-server.html

npm i --save-dev es-dev-server

for people (like me) looking for a drop in replacement for this that serves wasm files correctly, but also handles extensions nicely (as this does), npx serve is a fine replacement, as is npx local-web-server (theres a commandline option for setting default extension). these both fit all the needs I had for http-server, before I started needing to serve wasm, and they seem to serve wasm files with the correct content type.

es-dev-server will give a 404 if you omit the .html in file names (which differs from http-server and there does not appear to be a commandline arg to change it) and is also very slow. I don't know what it's doing but it takes a solid several seconds to quit after a ctrl-c (or multiple) and is just generally slow to use.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dKab picture dKab  路  7Comments

rgladwell picture rgladwell  路  7Comments

jondlm picture jondlm  路  6Comments

arthurkhlghatyan picture arthurkhlghatyan  路  3Comments

daGaiGuanYu picture daGaiGuanYu  路  5Comments