title: REST not working in AWS on Maven Project. Just locally
body: <p>So I created a Maven Project in NetBeans. Deployed to Amazon Elastic Beanstalk. I created the GET service (Working perfect locally) which connects to the Oracle DB.</p>
  
  <p><a href="https://i.stack.imgur.com/5o52V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5o52V.png" alt="Define Rest"></a></p>
  
  <p>Here's the code I use to access the GET service from my index, it works while deploying locally:</p>
  
  <p><a href="https://i.stack.imgur.com/DrTpa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DrTpa.png" alt="AJAX"></a></p>
  
  <p>And the method call with the URI:</p>
  
  <pre><code> self.ajax("http://127.0.0.1:8080/webresources/kpis/first/09/09/1994/second/20/02/2017", 'GET').done(function(data) {
    alert(data);
   });
  </code></pre>
  
  <p>(When running in locally y add /mavenproject1/ between 8080 and webresources).</p>
  
  <p>However,when deploying and running the code I can't get result. Chrome shows me this error in console "ERR_CONNECTION_REFUSED" (I suppose its because it can't find localhost while deployed). I believe its because it can't find localhost and it treats the REST as if it was a Cross-Domain Request. </p>
  
  <p><a href="https://i.stack.imgur.com/1M1Re.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1M1Re.png" alt="ERROR CHROME"></a></p>
  
  <p>I need to connect my FrontEnd with backend without exposing my REST to anybody. Can someone help me?</p>
  
  <p>Thanks.</p>