title: How to save json to a file using fetch() api?
body: <p>index.html file placed in a folder and same folder has save.json file. Im running sublime text with server extension. <strong>Error:</strong> save.json 404 not found.</p>
  <p>It can read from the same file but 404 when trying to write !</p>
  <p>Pics below:</p>
  <p><a href="https://i.stack.imgur.com/gd8XU.jpg" rel="nofollow noreferrer">Code</a></p>
  <p><a href="https://i.stack.imgur.com/X1uE3.jpg" rel="nofollow noreferrer">Folder of index and save</a></p>
  <p><a href="https://i.stack.imgur.com/F2C5o.jpg" rel="nofollow noreferrer">console error</a></p>
  <p>script below: <br></p>
  <p>var OBJ = { <br></p>
  <p>title: document.getElementById(&quot;title&quot;).innerHTML, <br>
  body: document.getElementById(&quot;body&quot;).innerHTML, <br>
  userId:  document.getElementById(&quot;userid&quot;).innerHTML, <br></p>
  <p>}; <br></p>
  <p>fetch('/save.json', { <br>
  method: 'POST', <br>
  body: JSON.stringify(OBJ), <br>
  headers: { <br>
  'Content-type': 'application/json; charset=UTF-8', <br>
  },<br>
  })<br>
  .then((response) =&gt; response.json())<br>
  .then((json) =&gt; console.log(json));<br></p>