Created
July 5, 2011 14:34
-
-
Save jamesalmond/1064943 to your computer and use it in GitHub Desktop.
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
source "http://rubygems.org" | |
gem 'goliath', :git => "git://github.com/postrank-labs/goliath.git" |
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 'bundler/setup' | |
require 'goliath' | |
class HelloWorld < Goliath::API | |
def response(env) | |
[200, {}, "Hello world"] | |
end | |
end | |
class NoRoutes < Goliath::API | |
map '/some_route', HelloWorld | |
end |
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
» ruby no_routes.rb -sv | |
[7874:INFO] 2011-07-05 15:25:42 :: Starting server on 0.0.0.0:9000 in development mode. Watch out for stones. | |
# request to http://localhost:9000/some_route | |
[7874:INFO] 2011-07-05 15:26:17 :: Status: 200, Content-Length: 11, Response Time: 15.28ms | |
# request to http://localhost:9000 | |
[7874:ERROR] 2011-07-05 15:25:49 :: stack level too deep | |
/Users/jamesalmond/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/set.rb:92 | |
[7874:INFO] 2011-07-05 15:25:49 :: Status: 500, Content-Length: 17, Response Time: 26.48ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment