Created
February 2, 2012 02:17
-
-
Save codespore/1720964 to your computer and use it in GitHub Desktop.
Rack middleware example
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 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