title: ExpressJS - res.redirect after DELETE request
body: <p>I have been searching all over for how to do this - I am trying to redirect after a DELETE request is made - here is the code I am using <strong>WITHOUT THE REDIRECT</strong>:</p>
  
  <pre><code>exports.remove = function(req, res) {
    var postId = req.params.id;
    Post.remove({ _id: postId }, function(err) {
      if (!err) {
              console.log('notification!');
              res.send(200);
      }
      else {
              console.log('error in the remove function');
              res.send(400);
      }
    });
  };
  </code></pre>
  
  <p><code>remove</code> gets called when an item (a post) is deleted. Everything works fine (I had to use <code>res.send(200)</code> to get it to not hang on the delete request) - but now I am having trouble redirecting. If I use <code>res.redirect('/forum')</code> inside the <code>remove</code> function, like this:</p>
  
  <pre><code>exports.remove = function(req, res) {
    var postId = req.params.id;
    Post.remove({ _id: postId }, function(err) {
      if (!err) {
              console.log('notification!');
              res.send(200);
      }
      else {
              console.log('error in the remove function');
              res.send(400);
      }
      res.redirect('/forum');
    });
  };
  </code></pre>
  
  <p>It registers the redirect as a <code>DELETE</code> request that is trying to delete <code>/forum</code>, like this:</p>
  
  <p><code>DELETE http://localhost:9000/forum 404 Not Found 4ms</code></p>
  
  <p>All I am trying to do is refresh the page so that the list of posts is updated after the delete. Can anyone help? </p>