title: express.js req.body undefined in middleware
body: <p>I'm currently facing a problem in my node application.</p>
  <p>while trying to use middleware in a post request the req.body becomes undefined.</p>
  <p>for example;</p>
  <pre><code>router.post('/newpost', ensureAuthenticated, createPost, upload.single('file'), async (req, res) =&gt;{
      console.log(req.body);
  }
  
  async function createPost(req, res, next){
      console.log(req.body);
      next();
  }
  </code></pre>
  <p>when the createPost function runs it logs req.body as undefined.
  but when req.body gets logged inside the router.post it is defined.</p>
  <p>is it something i'm missing? or is this just not possible to do.</p>
  <p>also i've ensured that i've included bodyparser and initialized it before my routes.</p>