Created
October 21, 2013 13:43
-
-
Save davidbella/7084087 to your computer and use it in GitHub Desktop.
Ruby: Basic Rack app with env and lambda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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