title: Node js, express delete file at path
body: <p>I have a photo model:</p>
  
  <pre><code>var photoSchema = mongoose.Schema({
      name: { type: String},
      path: { type: String},
      vehicle: { type: ObjectId, ref: 'Vehicle' }
    });
  </code></pre>
  
  <p>A photo is deleted with the route:</p>
  
  <pre><code>app.delete('/api/photos/:id/delete', photos.delete (app.get('photos')));
  </code></pre>
  
  <p>I can delete the photo from mongo using:</p>
  
  <pre><code>exports.deletePhoto = function (dir) {
    function (req, res, next) {
      var id = req.params.id;
      Photos.delete (id, function (err) {
        if (err) return next (err);
        return res.send ({
          status: "200",
          responseType: "string",
          response: "success"
        });
      });
    };
  };
  </code></pre>
  
  <p>The photo is saved on disk at </p>
  
  <pre><code>app.set('photos', __dirname + '/public/photos');
  </code></pre>
  
  <p>How do I delete the photo from disk in the deletePhoto function?</p>