Skip to content

Instantly share code, notes, and snippets.

@manji6
Last active December 14, 2015 08:09
Show Gist options
  • Save manji6/5056073 to your computer and use it in GitHub Desktop.
Save manji6/5056073 to your computer and use it in GitHub Desktop.
rubyを使って簡易webサーバー構築
# 起動
$ ruby -r webrick -e 'WEBrick::HTTPServer.new(:ServerName => "localhost", :DocumentRoot => "./", :Port => 8080, :MimeTypes => WEBrick::HTTPUtils::DefaultMimeTypes.merge({"js"=>"text/javascript"})).start'
# 停止
$ ps aux | grep ruby
$ kill -9 <pid>
// reference doc is here!
// http://www.ruby-lang.org/ja/old-man/html/WEBrick_HTTPServer.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment