Python has:
python3 -m http.server
But I like Ruby, so I do this instead:
# Basic:
ruby -run -e httpd
# With arguments:
ruby -run -e httpd -- -b 0.0.0.0 -p 9090
Note: there is no such thing as a
-run
flag for ruby, you’re doing-r
forrequire
and you’re loading theun.rb
file from the ruby core. Then-e
to evaluate thehttpd
function in that file.