Cannot POST with Node.js Express MongoDB Mongoose CoffeeScript Cannot POST with Node.js Express MongoDB Mongoose CoffeeScript express express

Cannot POST with Node.js Express MongoDB Mongoose CoffeeScript


The form sends a POST request to the server, but your route is for PUT requests.


I found the solution on http://expressjs.com/guide.html:

"When using methods such as PUT with a form, we can utilize a hidden input named _method, which can be used to alter the HTTP method. To do so we first need the methodOverride middleware, which should be placed below bodyParser so that it can utilize it’s req.body containing the form values."

app.use express.bodyParser()app.use express.methodOverride()