title: Express router.use not working
body: <p>I used express-generator to generate the basic structure of an express app.</p>
  
  <p>I have this in routes/my.js:</p>
  
  <pre class="lang-js prettyprint-override"><code> router.use('/update', function(req, res, next) {
      req.headers['content-type'] = 'application/json';
      console.log('router use invoked');
      next();
   });
  
  router.get('/update', function(req, res, next) {
      console.log('=== GET /my/update', req.body);
  });
  
  router.post('/update', function(req, res, next) {
      console.log('=== POST /my/update', req.body);
  });
  </code></pre>
  
  <p>And in app.js I added:</p>
  
  <pre class="lang-js prettyprint-override"><code>var my = require('./routes/my');
  
  app.use('/', routes);
  app.use('/users', users);
  app.use('/my', my);
  </code></pre>
  
  <p>It's working fine for GET, and the router middle-ware is actually working (console.log is called), but the headers is not being set to app/json (as the log message in post outputs the body to be empty).</p>
  
  <p>I can solve this by adding this <strong>before any other middle-ware</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>app.use('/my/update', function(req, res, next) {
    req.headers['content-type'] = 'application/json';
    next()
  });
  </code></pre>
  
  <p>And it works. I tried moving the <code>app.use('my', my);</code> line before any other middle-ware but it stopped working altogether.</p>
  
  <p>What can I do in order to give priority to my router.use?</p>