Skip to content

Instantly share code, notes, and snippets.

@andreiglingeanu
Created August 24, 2013 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreiglingeanu/6328402 to your computer and use it in GitHub Desktop.
Save andreiglingeanu/6328402 to your computer and use it in GitHub Desktop.
app = proc do |env|
res = Rack::Response.new
req = Rack::Request.new(env)
str = req.params['str']
res.finish do |res|
res['Content-Type'] = 'text/plain'
res.status = 200
res.write "Your string reversed is: #{str.reverse}"
end
end
run app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment