title: fetch endpoint javascript cordova
body: <p>I have a simple html page that looks like this:</p>
  <pre><code>&lt;div class=&quot;user-box&quot;&gt;
                  &lt;input type=&quot;text&quot; name=&quot;&quot; required=&quot;&quot;&gt;
                  &lt;label&gt;Username&lt;/label&gt;
                &lt;/div&gt;
                &lt;div class=&quot;user-box&quot;&gt;
                  &lt;input type=&quot;password&quot; name=&quot;&quot; required=&quot;&quot;&gt;
                  &lt;label&gt;Password&lt;/label&gt;
                &lt;/div&gt;
                &lt;a href=&quot;&quot; id=&quot;myButton&quot;&gt;
                  &lt;span&gt;&lt;/span&gt;
                  &lt;span&gt;&lt;/span&gt;
                  &lt;span&gt;&lt;/span&gt;
                  &lt;span&gt;&lt;/span&gt;
                  Submit
                &lt;/a&gt;
  </code></pre>
  <p>and what I have right now, in my <code>JS</code> file is:</p>
  <pre><code> var element = document.getElementById('myButton');
  element.onclick = function () { 
      fetch('http://localhost:6969/test');
   };
  </code></pre>
  <p>as you can see, I am trying to reach the localhost server hosting my backend code. In my localhost server, I have this:</p>
  <pre><code>app.get('/test', (req, res) =&gt; {
    console.log(&quot;this is actually pretty cool!&quot;)
  })
  </code></pre>
  <p>but it isn't reaching said endpoint, and isn't logging anything, actually it's not doing anything at all. What am I doing wrong?</p>