title: multer upload not working
body: <p>I am trying to use the file upload feature using multer.
  I'm always getting 404 error, how can I fix this?</p>
  
  <blockquote>
    <p>This is my <code>app.js</code> :</p>
  </blockquote>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var createError = require('http-errors');
  var express = require('express');
  var path = require('path');
  var cookieParser = require('cookie-parser');
  var logger = require('morgan');
  
  var indexRouter = require('./routes/index');
  var usersRouter = require('./routes/users');
  
  var app = express();
  
  var session = require('express-session');
  var flash = require('connect-flash');
  var mongoose = require('mongoose');
  
  var multer = require('multer');
  
  app.use(multer({
    dest: './uploads/'
  }).single('singleInputFileName'));</code></pre>
  </div>
  </div>
  </p>
  
  <blockquote>
    <p>This is my <code>router.js</code> :</p>
  </blockquote>
  
  <pre><code>router.post('/', function(req, res) {
     console.dir(req.files);
  });
  </code></pre>
  
  <blockquote>
    <p>And this is the form :</p>
  </blockquote>
  
  <pre><code>form(action='/' enctype='multipart/form-data')
   input(type='file' name='singleInputFileName')
   input(type='submit' value='Upload photo')
  </code></pre>
  
  <p><strong>Edit: I Have added this script to the app.js</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.post('/fileuploads', function(req, res) {
    upload(req, res, function(err) {
      console.log(req.body);
      console.log(req.files);
      if (err) {
        return res.end("Error uploading file.");
        console.log(err);
      }
      res.end("File is uploaded");
    });
  });</code></pre>
  </div>
  </div>
  </p>