I am developing a Rails application that uses the API backend for AJAX requests written using Sinatra.
The API works separately from Rails:
Rails: localhost:3000
API: localhost:9393
During production, we will proxy API requests using nginx.
The problem is that we do not have nginx in development mode, we use thin. So I need some kind of Rack middleware that I can add in development mode to proxy requests for me.
Can someone give me an example of how to do this?
source share