Created
May 4, 2010 16:07
-
-
Save tie-rack/389589 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
# Run the little Sinatra app on port 3000 and the big Rails app on | |
# port 3001. Run this file and hit them both at port 4000. | |
require 'rubygems' | |
require 'rack/proxy' | |
require 'thin' | |
class LittleProxy < Rack::Proxy | |
def rewrite_env(env) | |
if env['PATH_INFO'].match(/^\/little\//) | |
env['SERVER_PORT'] = '3000' | |
else | |
env['SERVER_PORT'] = '3001' | |
end | |
env | |
end | |
end | |
Rack::Handler::Thin.run(LittleProxy.new, :Port => 4000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment