[1] https://github.com/xonixx/serv
[2] https://medium.com/cmlteam/develop-a-utility-on-graalvm-cc16...
51–60 of 100 posts
[1] https://github.com/xonixx/serv
[2] https://medium.com/cmlteam/develop-a-utility-on-graalvm-cc16...
Earlier quoted context omitted.
> go has popularized long args, with a single hyphen (-name etc) Why did they do that? It took us 20 years to standardize on - for short and -- for long, with occasional finger rage on tar or find, and now this? What were they thinking?
My hunch is that Rob Pike, Ken Thompson, Russ Cox and the other Bell Labs alumni behind Go disliked GNU getopt-style flags, like they dislike a lot of other GNU and BSD decisions that "contaminate" the original philosophy behind Unix. This overall attitude has led to many design decisions in Go, which define the language for better or worse. Statically-linked executables, for instance, contributed more than anything…
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..
(2013). There are many comments since then providing more alternatives, many of which didn’t exist back in 2013, but the article itself hasn’t been touched since 2013-07-07.
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..
If you have npm installed then simply doing npx serve is very easy
For python3 this is easily remedied.
python -m http.server -b ::
On most OS configurations this will listen on both IPv4 and IPv6.Or for when you only need local access:
python -m http.server -b localhostThe ruby one with the -run option is a bit nonintuitive in how it works. $ ruby -run -ehttpd . -p8000 The -r option requires un.rb[1] which is a file full of convenience functions, such as httpd in this example. Classic Ruby. Given that go has popularized long args with a single hyphen (-name etc), it is easy to mistake -run as an option by itself. [1] https://github.com/ruby/ruby/blob/master/lib/un.rb#L323
(Tip: can hit “y” on GitHub to change the URL to a revision-based permalink)
Note that a lot of these bind to 0.0.0.0 by default. This has caused me surprises in the past as I was failing to connect to a host that is available over IPv6. Sometimes it was even intermittent as I would sometime resolve to the IPv4 and sometimes get the IPv6 and fail. For python3 this is easily remedied. python -m http.server -b :: On most OS configurations this will listen on both IPv4 and IPv6. Or for when you…