Created
February 27, 2011 03:01
-
-
Save igrigorik/845866 to your computer and use it in GitHub Desktop.
goliath hello world example
This file contains 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
require 'goliath' | |
class Hello < Goliath::API | |
# default to JSON output, allow Yaml as secondary | |
use Goliath::Rack::Render, ['json', 'yaml'] | |
def response(env) | |
[200, {}, "Hello World"] | |
end | |
end | |
# > ruby hello.rb -sv | |
# > [97570:INFO] 2011-02-15 00:33:51 :: Starting server on 0.0.0.0:9000 in development mode. Watch out for stones. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment