Sha256: 0e0c647b6e9bc8423d3dd22d972622ab9e561aad13e72f1f50f36e4c4cdde698

Contents?: true

Size: 473 Bytes

Versions: 65

Compression:

Stored size: 473 Bytes

Contents

#!/usr/local/bin/ruby
require 'webrick'
include WEBrick

s = HTTPServer.new( :Port => 4000 )

# HTTPServer#mount(path, servletclass)
#   When a request referring "/hello" is received,
#   the HTTPServer get an instance of servletclass
#   and then call a method named do_"a HTTP method".

class HelloServlet < HTTPServlet::AbstractServlet
  def do_GET(req, res)
    res.body = "hello!"
    res['Content-Type'] = "text/html"
  end
end
s.mount("/test", HelloServlet)

s.start

Version data entries

65 entries across 65 versions & 9 rubygems

Version Path
engineyard-mongrel-1.1.4 examples/webrick_compare.rb
freels-mongrel-1.1.2 examples/webrick_compare.rb
headius-mongrel-1.1.6.1 examples/webrick_compare.rb
phurley-mongrel-1.1.6.1 examples/webrick_compare.rb
mongrel-maglev--1.1.9.0.1 examples/webrick_compare.rb
puma-0.8.2-java examples/webrick_compare.rb
puma-0.8.2 examples/webrick_compare.rb
puma-0.8.1 examples/webrick_compare.rb
puma-0.8.0 examples/webrick_compare.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/examples/webrick_compare.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/examples/webrick_compare.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/examples/webrick_compare.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/examples/webrick_compare.rb
mongrel-1.2.0.pre2-x86-mswin32 examples/webrick_compare.rb
mongrel-1.2.0.pre2-x86-mingw32 examples/webrick_compare.rb
mongrel-1.2.0.pre2 examples/webrick_compare.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/examples/webrick_compare.rb
sho-mongrel-1.1.5 examples/webrick_compare.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/mongrel-1.1.5/examples/webrick_compare.rb
mongrel-0.3.10.1 examples/webrick_compare.rb