Skip to content

Instantly share code, notes, and snippets.

@davidbella
Created October 21, 2013 13:43
Show Gist options
  • Save davidbella/7084087 to your computer and use it in GitHub Desktop.
Save davidbella/7084087 to your computer and use it in GitHub Desktop.
Ruby: Basic Rack app with env and lambda
class RackApp
def call(env)
[200, {"Content-Type" => "text/html"}, ["Hello Rack! - you requested #{env["REQUEST_PATH"]}"]]
end
end
run RackApp.new
# lambda.call -- rack uses .call
#run lambda { |env| [200, {"Content-Type" => "text/html"}, [env.to_s]] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment