Skip to content

Instantly share code, notes, and snippets.

@tomas-stefano
Created November 1, 2012 01:49
Show Gist options
  • Save tomas-stefano/3991111 to your computer and use it in GitHub Desktop.
Save tomas-stefano/3991111 to your computer and use it in GitHub Desktop.
Goliath and Routing
source :rubygems
gem 'goliath', '1.0.0'
gem 'rack', '1.4.1'
require 'bundler/setup'
Bundler.require
MyRackApp = Rack::Builder.new do
map '/' do
run Proc.new { [200, {}, 'Hi! Root page!'] }
end
map '/version' do
run Proc.new { [200, {}, 'testing_0.11.1'] }
end
end
class HelloWorld < Goliath::API
def response(env)
MyRackApp.call(env)
end
end
@lucascaton
Copy link

Awesome! :-)

@cfcosta
Copy link

cfcosta commented Nov 1, 2012

O goliath tem um esquema próprio pra rotas, não?

@badosu
Copy link

badosu commented Nov 1, 2012

Really cool!

@tomas-stefano
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment