serve current directory from command line

后端 未结 8 1628
梦如初夏
梦如初夏 2020-12-04 05:15

could someone give me a hint, howto serve the current directory from command line with ruby? it would be great, if i can have some system wide configuration (e.g. mime-types

8条回答
  •  情书的邮戳
    2020-12-04 05:48

    require 'webrick'
    include WEBrick
    
    s = HTTPServer.new(:Port => 9090,  :DocumentRoot => Dir::pwd)
    trap("INT"){ s.shutdown }
    s.start
    

提交回复
热议问题