Live data from Hacker News

Big list of HTTP static server one-liners

gist.github.com

31–40 of 100 posts

Re: Big list of HTTP static server one-liners

#33

$ emrun --port 8000 . # Handles WASM; most others don't.[1] [1] Emscripten's emsdk includes emrun, which actually serves WASM files with the correct MIME type out-of-the-box, unlike the python2 and python3 servers and most others.

Does emrun allow CORS, required for SharedArrayBuffers?

Re: Big list of HTTP static server one-liners

#34

Anybody has a one-liner allowing CORS (e.g. through options)? That would be utterly convenient to quickly test multithread WASM applications... I'm currently using ExpressJS for that, but it feels overkill..

I think these are meant for development setups, which you normally run in a localhost context, meaning you most likely won't have to deal with CORS.

But, if you still need it, the http-server program has a --cors flag to enable wildcard CORS.

Re: Big list of HTTP static server one-liners

#35

Anybody has a one-liner allowing CORS (e.g. through options)? That would be utterly convenient to quickly test multithread WASM applications... I'm currently using ExpressJS for that, but it feels overkill..

I think these are meant for development setups, which you normally run in a localhost context, meaning you most likely won't have to deal with CORS. But, if you still need it, the http-server program has a --cors flag to enable wildcard CORS.

Thanks!! I'll try it again, the last time I did I thought it was not allowing the right setting, but yeah a wildcard CORS should be enough of course.
Post reply on HN