Created
November 1, 2012 01:49
-
-
Save tomas-stefano/3991111 to your computer and use it in GitHub Desktop.
Goliath and Routing
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
| source :rubygems | |
| gem 'goliath', '1.0.0' | |
| gem 'rack', '1.4.1' |
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
| 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 |
O goliath tem um esquema próprio pra rotas, não?
Really cool!
Author
@cfcosta foi removido na versão 1.0.0. Detalhes: https://groups.google.com/forum/?fromgroups=#!topic/goliath-io/SZxl78BNhUM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome! :-)