title: Having a hard time getting Api from localhost?
body: <p>I am on this project wherein I need the api from this specific software. I cannot fetch it when I am trying to fetch it, sometimes error 404 are occuring,
  sometimes no-cors policy.
  Then sometimes like this: GET http://localhost:8000/events/1003/results net::ERR_CONNECTION_REFUSED
  getEvents @ orbiter.js:22
  (anonymous) @ orbiter.js:28
  Then sometimes Uncaught (in promise) TypeError:</p>
  <p>There are no authorization that needed based on the documentation or headers. Or i thought so it does not have?
  But i think this is because of the way that I am fetching the API, it looks like I am doing it wrong. The API as i am trying to get on the instruction on the documentation it says i can access it on &quot;localhost&quot;</p>
  <p>At first i just need to open the software to have access on the localhost so the http port will open, then i go to &quot;localhost&quot; then everything is on that local host</p>
  <p>This are the picture <a href="https://i.stack.imgur.com/pbKzb.png" rel="nofollow noreferrer">Screenshot of The LocalHost I need to access</a></p>
  <p>Now based on this I need to get the result of the event. Based on the documentation I need to go to path &quot;localhost/events/{event-id}/results&quot; then a json format would be send back to me.</p>
  <p>I go to the url using browser using that path and I get the result, <a href="https://i.stack.imgur.com/cNmbV.png" rel="nofollow noreferrer">This are the result based on that path</a> but this are the thing, when I am trying to put it on the code using Javascript language es6 module wherein I am fetching the api and I put the link &quot;localhost/events/{event-id}/results&quot;</p>
  <p>this are the code:</p>
  <pre><code>const link = &quot;http://localhost/events/1003/results&quot;;
  async function getEvents() {
    const response = await fetch(link);
    const data = await response.json();
    console.log(data);
    return data;
  }
  
  getEvents();
  </code></pre>
  <p>I cannot access now the data that I needed from the API. Even though the path on the link that I put was correct. Am i missing some steps here? That's all. As you can see, localhost is the main path, then i just follow the path based on the documentation to get the results. (Because what i need to access are the results of the events). Then errors has occurred. This are the documentation that may help you to help me. I hope some of you may help me on this one as I'm still a beginner on programming</p>
  <p><a href="https://drive.google.com/drive/u/0/folders/1Il6GPL-pqxeS8OWVOEt36OF-a_FfQwpj" rel="nofollow noreferrer">https://drive.google.com/drive/u/0/folders/1Il6GPL-pqxeS8OWVOEt36OF-a_FfQwpj</a></p>