title: implement rest html frontend PATCH
body: <p>I'm new to this. To practice, I am currently creating a REST API with nodejs and express, with the following endpoints:</p>
  <ul>
  <li>GET site.tld/project/21 -&gt; Show Project 21</li>
  <li>POST site.tld/project/33 -&gt; Create Project 33</li>
  <li>PATCH site.tld/project/44 -&gt; Change project 44</li>
  <li>DELETE site.tld/project/55 -&gt; Delete project 55</li>
  </ul>
  <p>etc</p>
  <p>I want have a Website, to Show, Create, Patch and Delete Projects. So I implement the REST Client in the browser via javascript. I have built a nice frontend with Bootstrap. To send the PATCH requests from the frontend to the backend I use a script with fetch(),</p>
  <p>Now my question:</p>
  <p>If I want to make an HTTP PATCH or DELETE request to the API, I need the ID of the project. How do I get the ID of the project in the frontend?</p>
  <p>I found the following possibilities:</p>
  <ul>
  <li><p>Get and Extract the URL with window.location.href in the frontend, since the URL of the Webpage to edit the Project contains the ID, e.g: url is &quot;site.tld/project/33&quot; so the ID are &quot;33&quot;.</p>
  </li>
  <li><p>I use ejs templates, I can send the ID from the backend to the frontend, and bind the data to an html data-* Tag and extract this via javascript.</p>
  </li>
  </ul>
  <p>None of this doesn't feel right. Can someone please explain to me what the correct way is?</p>