title: Node.js - Express 4.x - method-override not handling PUT request
body: <p>I am attempting to have the server handle a PUT request. But to no avail. The client keeps receiving "Cannot POST /" message after submitting the form.  <strong>I am using Express 4.x.</strong>  </p>
  
  <p>Note that if I change "put" to "post" in my route, the request gets handled just fine...</p>
  
  <p>How can I have my server handle the 'PUT' request?</p>
  
  <p><strong>SERVER:</strong></p>
  
  <pre><code>var express         = require("express");
  var bodyParser      = require("body-parser");
  var methodOverride  = require("method-override");
  
  var app             = express();
  
  app.use(bodyParser());
  app.use(methodOverride());
  
  
  app.get("/",function(req,res){
      res.render("index.ejs");
      console.log("GET received.");
  });
  app.put("/",function(req,res){
      console.log("PUT received: " + req.body.userName + " - " + req.body.password);
  });
  
  app.listen(1337);
  console.log("Listening on 1337.");
  </code></pre>
  
  <p><strong>CLIENT</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;TODO supply a title&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form action="/" method="post"&gt;
              First
              &lt;input type="text" name="first"&gt;
              Last
              &lt;input type="text" name="last"&gt;
              &lt;input type="hidden" name="_method" value="put"&gt;
              &lt;button type="submit"&gt;Submit&lt;/button&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>