I'm trying to do something like this:
class Dispatcher < Sinatra::Base
def initialize
@foo = Foo.new
end
get '/foo/*' do
@foo.call(params[:splat])
end
end
So that URL /foo/abc/def?xxx=yyy would be like calling the Foo app with /abc/def?xxx=yyy.
This seems like it should be easy, but I haven't seen any example of it.
I'm not sure why you would use Sinatra for that. If I understand you right, and you use Apache with Proxy-Rewrite rules you just do:
The .htaccess file
So all your
domain.tdl/foo
get redirected to your local running app athttp://localhost:61000/
with all Post and Get Parameters.I ended up doing this in a Rack config.ru file:
Not exactly what I wanted, but saves me from modifying the underlying app.