Created
December 7, 2015 05:13
-
-
Save phemmer/d45712922156d408abb4 to your computer and use it in GitHub Desktop.
ruby rack hello world
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
| #!/usr/bin/ruby | |
| require 'rack' | |
| require 'rack/server' | |
| class HelloWorld | |
| def response | |
| [200, {}, 'Hello World'] | |
| end | |
| end | |
| class HelloWorldApp | |
| def self.call(env) | |
| HelloWorld.new.response | |
| end | |
| end | |
| Rack::Server.start :app => HelloWorldApp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment