Express JS unable to PUT/DELETE
<p>Project structure</p>

<pre><code>.app.js
.routes/
....resources.js
</code></pre>

<p>I have the following server instance running:</p>

<p><em>app.js</em></p>

<pre><code>"use strict";
const app = require('express')();
const resources = require('./routes/resources');

app.use('/', resources);

const server = app.listen('3000', () =&gt; {
  let host = server.address().address;
  host = (host == '::' ? 'localhost' : host);
  const port = server.address().port;
  // log it
  console.log('listening at http://%s:%s', host, port);
});
</code></pre>

<p>I have the GET and POST requests working (routes/resources.js) fine i.e. </p>

<pre><code>"use strict"
const express = require('express');
const router = express.Router();
const bodyParser = require('body-parser');
//parser
router.use(bodyParser.json()); // for parsing application/json
router.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
// data
let resources = [{
  id: 1,
  name: 'Foo'
}];

// POST
router.post('/resources', (req, res) =&gt; {
  let item = req.body;
  //send status
  if (!item.id) {
    return res.sendStatus(500);
  }
  // saved as a string, id must be int
  item.id = parseInt(item.id, 10);
  // add id
  resources.push(item);
  // send the response of new resource
  res.send('/resources/' + parseInt(item.id, 10));
});
</code></pre>

<p>Using Postman I can successfully post, however the following PUT and DELETE 
give me the <em>Cannot DELETE /resources/</em> message:</p>

<pre><code>// PUT
router.put('/resources/:id', (req, res) =&gt; {
  // get id from request
  let id = parseInt(req.body.id, 10);
  // find existing id in resources
  let existingItem = resources.filter(r =&gt; r.id === id)[0];
  // if it doesn't exist
  if(!existingItem) {
    let item = req.body;
    item.id = id;
    resources.push(item);
    res.setHeader('Location', '/resources/' + id);
    res.sendStatus(201)
  } else {
    existingItem.name = req.body.name;
    res.sendStatus(204);
  }
});
// DELETE
router.delete('/resources/:id', (req, res) =&gt; {
  let id = parseInt(req.body.id, 10);
  let existingItem = resources.filter(r =&gt; r.id === id)[0];

  if (!existingItem) {
    return res.sendStatus(404)
  }
  resources = resources.filter(r =&gt; r.id !== id);
  res.sendStatus(204)
});
</code></pre>

<p>Head scratching as to why, though it may be that the answer is staring me in the face. Any help would be appreciated!</p>