title: Cannot access to req.body inside middlewares
body: <p>I actually have a very tiny app in node.js with Express, and I can't access to req.body.</p>
  
  <p>This is my <code>app.js</code> code:</p>
  
  <pre><code>var express = require('express'),
      middleware = require('./middleware'),
      mysql  = require('mysql'),
      app = express();
  
  app.use(middleware.authenticate);
  app.use(middleware.getScope);
  
  app.listen(3000);
  module.exports = app;
  </code></pre>
  
  <p>And the file with the middlewares:</p>
  
  <pre><code>var bcrypt = require('bcrypt'),
      mysql  = require('mysql');
  
  function authenticate(req, res, next){
     console.log(req.body);
      next();
  }
  
  function getScope(req, res, next){
      console.log(req.body);
      next();
  }
  
  module.exports.authenticate = authenticate;
  module.exports.getScope = getScope;
  </code></pre>
  
  <p>In all cases req.body is <code>undefined</code>.</p>
  
  <p>I'm sending data throw Postman with <code>x-www-form-urlencoded</code> protocol, in this case is a must.</p>
  
  <p><a href="https://i.stack.imgur.com/F2fc3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F2fc3.png" alt="enter image description here"></a></p>
  
  <p>Thanks!!</p>