Declarative forwarding rack middleware based on https://gist.github.com/chneukirchen/32376.
Add this line to your application's Gemfile:
gem "rack-forwarder"
And then execute:
$ bundle
Or install it yourself as:
$ gem install rack-forwarder
require "rack/forwarder"
use Rack::Forwarder do
# Forward /foo/bar to http://localhost:5000/bar
forward %r{/foo(/bar)}, to: "http://localhost:5000$1"
# Forward /foo to http://localhost:5000/foo
forward %r{/foo}, to: "http://localhost:5000"
end
- Fork it ( https://github.com/[my-github-username]/rack-forwarder/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request