Skip to content

Instantly share code, notes, and snippets.

@codespore
Created February 2, 2012 02:17
Show Gist options
  • Select an option

  • Save codespore/1720964 to your computer and use it in GitHub Desktop.

Select an option

Save codespore/1720964 to your computer and use it in GitHub Desktop.
Rack middleware example
class SimpleRackApp
def call(env)
[200, {}, ["Hello World!"]]
end
end
use Rack::ContentType, 'text/plain' # Adds the Rack::ContentLength middleware in the application middleware stack
run SimpleRackApp.new # Specifies the main rack application to run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment