Skip to content

Instantly share code, notes, and snippets.

@igrigorik
Created February 27, 2011 03:01
Show Gist options
  • Save igrigorik/845866 to your computer and use it in GitHub Desktop.
Save igrigorik/845866 to your computer and use it in GitHub Desktop.
goliath hello world example
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