Cyril Rohr
Cyril Rohr.

One-liner to start a local HTTP server [ruby]


Wow, is it really what it takes to start an HTTP server serving static files from the current directory with standard Ruby?

ruby -r webrick -e "s = WEBrick::HTTPServer.new(:Port => 8888);\
  s.mount('/',WEBrick::HTTPServlet::FileHandler, './'); \
  trap('INT'){ s.shutdown }; \
  s.start"

For once I prefer the python way.