Reputation: 1804
I have a Sinatra backend under rackup and a HTML site running under Apache, on a different port. So whenever I do a Ajax post from the HTML site, I get Cross Domain issue. How can I deploy both the backend and the frontend on the same machine without using Sinatra templating, but still having the same domain?
Upvotes: 1
Views: 79
Reputation: 55937
Add a proxy setting to your HTTP server config
ProxyPass /MyService http://serviceHost:9080/MyService
This example assumes that your frontend is server from the HTTP server on on port 80, and the service you want to call is on port 9080, it makes the service appear to be available on port 80.
Upvotes: 1