Created
January 3, 2012 17:53
-
-
Save pelted/1556078 to your computer and use it in GitHub Desktop.
Sinatra request with RestClient to API in same rack app
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
#config.ru | |
... | |
map "/api" do | |
run MyApi | |
end | |
map "/" do | |
run MyApp | |
end | |
#my-app.rb | |
... | |
get '/people/?' do | |
## This causes request to this route to time out however if send a request directly to | |
## http://127.0.0.1:9393/api/people then no problem. The API is correct. | |
@results = RestClient.get "http://127.0.0.1:9393/api/people", {:accept => :json} | |
erb :people | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment