title: How to make a delete route with Express API
body: <p>I am trying to delete records from mongodb with an API using MEAN-stack. my application sucessfully calls the API but the API does not delete anything. I'm using a get request because 'del' or 'delete' causes even more trouble.</p>
  <p>application (typescript):</p>
  <pre><code>DeleteSurvey(){
      var obj = this.surveys[this.listnames.indexOf(this.ListId)];
  
      this.http.get('http://127.0.0.1:3000/api/surveys/{&quot;id&quot;:&quot;' + obj._id + '&quot;}').subscribe(data =&gt; {
        console.log(data);
      });
  }
  </code></pre>
  <p>API:</p>
  <pre><code>router.get('/surveys/:id', async (req, res) =&gt; {
      const id = JSON.parse(req.params.id);
      console.log(id);
      const message = await Survey
       .findByIdAndRemove(id)
       .then(() =&gt; 'Survey deleted');
       res.json(message);
  });
  </code></pre>