tags:

views:

52

answers:

1

On production my application runs in a virtual directory eg /virt/action

get '/action'
...
end

I want to have the /virt also when running sinatra in development mode, is there a way to do that?

A: 

Try using Rack middleware. You should be able to use a middleware class only in development that intercepts /virt/action and remaps it to /action. This may be overkill in your case, but Rack Rewrite would probably do the trick.

Brian Deterling
Thanks, I used varnish in front of my webserver (nginx) which modifies the url sent and voila... same urls in dev and prd.
Piotr Zolnierek