#!/usr/bin/env ruby
# -*- coding: utf-8 -*- x0
#		http://localhost:3000/hello.rb
#require 'webrick'
#include WEBrick

#module WEBrick::HTTPServlet
#FileHandler.add_handler('sh', CGIHandler)
#FileHandler.add_handler('cgi', CGIHandler)
#end

#s = HTTPServer.new(
# :Port => (ENV["PORT"]||3000),
# :DocumentRoot => ENV["DOCROOT"]||".",
# :DirectoryIndex => ["hello_after.rb"]
#)
#trap("INT") { s.shutdown }
#s.start
#!/usr/bin/env ruby
#-*- encoding: utf-8 -*- 
# $B@_CVJ}K!(B:
#		http://localhost:3000/hello.rb

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'webrick'
include WEBrick

module WEBrick::HTTPServlet
  FileHandler.add_handler('rb', HTTPServlet::CGIHandler)
  FileHandler.add_handler('sh', HTTPServlet::CGIHandler)
  FileHandler.add_handler('cgi', HTTPServlet::CGIHandler)
end

# $B%I%-%e%a%s%H%k!<%H$r@5$7$$%G%#%l%/%H%j$K@_Dj$9$k(B
doc_root = File.expand_path('.')  # $BNc(B: $BE,@Z$J%G%#%l%/%H%j$K=$@5$9$k(B

s = WEBrick::HTTPServer.new(
  :Port => (ENV["PORT"] || 3000),
  :DocumentRoot => doc_root,
  :DirectoryIndex => ["index.html", "index.cgi", "hello_after.rb"]  # $BE,@Z$J%$%s%G%C%/%9%U%!%$%k$r;XDj$9$k(B
)

trap("INT") { s.shutdown }
s.start
