Live data from Hacker News

Big list of HTTP static server one-liners

gist.github.com

11–20 of 100 posts

Re: Big list of HTTP static server one-liners

#13

The 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

> 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?

Re: Big list of HTTP static server one-liners

#14

The 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

> 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?

The XWindow system used -long -opts long before that.

Re: Big list of HTTP static server one-liners

#17

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?

The XWindow system used -long -opts long before that.

The XWindow system is a collection of the worse api in the world so it's no surprise.

But the vast majority of modern command line tools agree on --long.

Re: Big list of HTTP static server one-liners

#20

Is there a way of doing that in a Windows without installing anything?

Windows ships with a web server (IIS), but you need to activate it in Features. Not sure if that counts as installing or not to you.

https://www.betterhostreview.com/turn-on-iis-windows-10.html

Post reply on HN