I'm trying to deploy a runnable JAR using Restlet framework that offers some APIs for my little SPA.
I am using Apache2 which is listening on port 80, I've got all my index.html, js, css and etc files in
The problem arose when I tried to use the APIs on the front end, if I don't set the port number for making requests on the front end (using relative address), and make the jar listen on port 80, nothing happens. Then I switched to absolute address and forced the frontend and backend to communicate on port 8015 for the APIs. Currently I have made my API work by allowing cross-domain requests in my API response headers (as a result of using absolute address).
I am wondering what should I have really done to be able to use relative address and get rid of Cross-Domain requests? If apache2 listens on port 80 is it able to figure out which request to send back a HTML or forward to my Restlet?