title: How to enable DELETE request?
body: <p>I'm not able to allow the <code>DELETE</code> request from my API server due to CORS.</p>
  
  <h3>server.js</h3>
  
  <pre><code>// enable CORS
  app.use(function (req, res, next) {
      res.header("Access-Control-Allow-Origin", "*");
      res.header("Access-Control-Allow-Methods", "GET", "PUT", "POST", "DELETE", "OPTIONS");
      res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
      next();
  });
  </code></pre>
  
  <p>I get a console error saying:</p>
  
  <p><code>XMLHttpRequest cannot load http://localhost:8080/api/users/57f5036645c04700128d4ee0. Method DELETE is not allowed by Access-Control-Allow-Methods in preflight response</code></p>
  
  <p>How can I enable <code>DELETE</code> requests, just like <code>GET</code>, <code>PUT</code>, and <code>POST</code> requests?</p>