Skip to content

Instantly share code, notes, and snippets.

@wjessop
Created November 10, 2009 16:41
Show Gist options
  • Save wjessop/231019 to your computer and use it in GitHub Desktop.
Save wjessop/231019 to your computer and use it in GitHub Desktop.
require "rubygems"
require "rack"
$log = File.open('wlog', 'w')
def run(server)
require server
s = Rack::Handler.const_get("#{server.capitalize}")
app = proc {|env|
$log.puts env["rack.input"].readlines
[200, {"Content-Type" => "text/plain"}, ""]
}
s.run(app,:Host => '127.0.0.1', :Port => 2324)
end
run "thin"
at_exit {
$log.close
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment