- Create your own subclass of
include Proximityinto that class.
Rack::Proxy's call so your
env['PATH_INFO']will be changed before your call to
- If you override
call, ensure you call super.
- Create your proxy routes in a
proxies.rbfile and require it in your application.
# my_proxy.rb class MyProxy < Rack::Proxy include Proximity end # proxies.rb MyProxy.routes.draw do route 'example' => 'example.com/api' do proxy 'active' => 'accounts/active' proxy 'accounts' => same, formats %w[json csv] proxy 'accounts/:account_id' => same proxy 'crazy/:id/:account_id' => 'fluffy/kitties/:id-:account_id' end end
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install proximity
- Fork it
- 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 new Pull Request