title: method post failed to load resource the server responded with a status 404
body: <p>Im new in Springboot, so im getting this error</p>
  <blockquote>
  <p>POST http://localhost:63342/insacol/static/api/users 404 (Not Found). registerUser.js:20
  Uncaught (in promise) SyntaxError: Unexpected token &lt; in JSON at position 0</p>
  </blockquote>
  <p>js code:</p>
  <pre><code>// Call the dataTables jQuery plugin
  $(document).ready(function() {
  
  });
  
  
    async function registerUser(){
        let dates ={};
        dates.name = document.getElementById('txtName').value;
        dates.lastname = document.getElementById('txtLastName').value;
        dates.email = document.getElementById('txtEmail').value;
        dates.password = document.getElementById('txtPassword').value;
        let repeatPassword = document.getElementById('txtRepeatPassword').value;
  
        if (repeatPassword != dates.password){
            alert('La contraseña es diferente');
            return;
        }
      console.log(dates);
      const request = await fetch('api/users', { method: 'POST', headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json'
        }
      });
      body: JSON.stringify(dates)
      const users = await request.json()
    }
  </code></pre>
  <p>java code:</p>
  <pre><code>@RequestMapping(value = &quot;api/users&quot;, method = RequestMethod.POST)
      public void insertUser(@RequestBody User user){
          userDao.insertar(user);
      }
  </code></pre>
  <p>html code:</p>
  <pre><code>&lt;a onclick=&quot;registerUser()&quot; href=&quot;#&quot; class=&quot;btn btn-primary btn-user btn-block&quot;&gt;Register Usuario&lt;/a&gt;
  </code></pre>