Created
January 12, 2010 16:20
-
-
Save santiago/275321 to your computer and use it in GitHub Desktop.
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 'sinatra' | |
require 'sinatra/async' | |
require 'app' | |
class AsyncRoutes < Sinatra::Application | |
register Sinatra::Async | |
enable :sessions | |
configure :development do | |
set :couchdb_server, 'http://localhost:5984' | |
set :error_log_url, 'http://localhost:5984/errors' | |
end | |
# set sinatra's variables | |
set :app_file, __FILE__ | |
set :root, File.dirname(__FILE__) | |
apost '/bosh/chat' do | |
r= RestClient::Resource.new "http://localhost:5280/http-bind", :timeout=>61 | |
response= r.post(request.body.string) | |
# deliver response only when it is ready | |
body response | |
end | |
end | |
run AsyncRoutes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment