Skip to content

Instantly share code, notes, and snippets.

@pgr0ss
Created November 15, 2011 00:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgr0ss/1365729 to your computer and use it in GitHub Desktop.
Save pgr0ss/1365729 to your computer and use it in GitHub Desktop.
Simple rack app
require 'stringio'
rack_app = Proc.new do |env|
body = env.map {|k,v| "#{k} => #{v}"}.join("\n")
[ 200, {"Content-Type" => "text/plain"}, StringIO.new(body)]
end
run rack_app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment