Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 /var/www/.

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?

share|improve this question

closed as off topic by allquixotic, Everett, Ƭᴇcʜιᴇ007, ChrisF, Renan Jan 12 '13 at 14:41

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged .