title: Set multer properties inside an express route
body: <p>Instead of attaching <code>multer</code> to the entire express <code>app</code>, i am trying to include it just for specific routes, which is better since you will be preventing uploads to every route handling <code>post</code>.</p>
  
  <p>Problem is, i am unable to set it properties inside a route.</p>
  
  <pre><code>var router = require('express').Router(),
  multer = require('multer');
  
  router.post('/uploads', function (req, res, next) {
     multer({
       dest: req.app.get('cfg').uploads.dir
     });
  
     console.log(req.files); process.exit();
  
  });
  </code></pre>
  
  <p>Here, <code>req.files</code> is undefined.</p>
  
  <p>The same thing happens if i put multer in a seperate middleware and attach it to the above route.</p>
  
  <pre><code>function initMulter(req, res, next) {
      multer({
       dest: req.app.get('cfg').uploads.dir
     });
  
     next();
  }
  
   router.post('/uploads', initMulter, function (req, res, next) {
     console.log(req.files); process.exit();
  
  });
  </code></pre>
  
  <p>Also in this case, <code>req.files</code> is <code>undefined</code>.</p>
  
  <p>Is there something really wrong that i am doing or should i start blaming the beer?</p>