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
-runflag for ruby, you’re doing-rforrequireand you’re loading theun.rbfile from the ruby core. Then-eto evaluate thehttpdfunction in that file.