Sha256: ee475ccfff454df045ec2df611851c2caba52b3d89ec50e1c1f2131c1b001551

Contents?: true

Size: 723 Bytes

Versions: 69

Compression:

Stored size: 723 Bytes

Contents

require 'webrick'

class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
  def do_POST(request, response)
    File.open('story', 'w') do |io|
      io.write(request.body)
    end

    response.status = 200
    response['Content-Type'] = 'text/html'
    response.body = "body"
  end
end

params = { :Port        => 4000,
           :ServerType  => WEBrick::SimpleServer,
           :BindAddress => "0.0.0.0",
           :MimeTypes   => WEBrick::HTTPUtils::DefaultMimeTypes }
server = WEBrick::HTTPServer.new(params)
server.mount('/stories', DispatchServlet)
server.mount('/', WEBrick::HTTPServlet::FileHandler, File.dirname(__FILE__) + '/..', { :FancyIndexing => true })

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

Version data entries

69 entries across 69 versions & 12 rubygems

Version Path
dchelimsky-rspec-1.1.10 story_server/prototype/lib/server.rb
dchelimsky-rspec-1.1.11.1 story_server/prototype/lib/server.rb
dchelimsky-rspec-1.1.11.2 story_server/prototype/lib/server.rb
dchelimsky-rspec-1.1.11.3 story_server/prototype/lib/server.rb
dchelimsky-rspec-1.1.11.4 story_server/prototype/lib/server.rb
dchelimsky-rspec-1.1.11.5 story_server/prototype/lib/server.rb
dchelimsky-rspec-1.1.11.6 story_server/prototype/lib/server.rb
dchelimsky-rspec-1.1.11.7 story_server/prototype/lib/server.rb
dchelimsky-rspec-1.1.11 story_server/prototype/lib/server.rb
dchelimsky-rspec-stories-1.0.0 story_server/prototype/lib/server.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/story_server/prototype/lib/server.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/story_server/prototype/lib/server.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/story_server/prototype/lib/server.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/story_server/prototype/lib/server.rb
samstokes-rspec-stories-1.0.1 story_server/prototype/lib/server.rb
samstokes-rspec-stories-1.0.2 story_server/prototype/lib/server.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/story_server/prototype/lib/server.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/story_server/prototype/lib/server.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/story_server/prototype/lib/server.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/story_server/prototype/lib/server.rb