Q37: Why was body-parser required in Express and how is it used now?

Earlier Express versions required the body-parser module to parse incoming request bodies. Modern Express (v4.16+) includes built-in body parsing via express.json() and express.urlencoded().

Key Takeaways
  • Parses request payload bodies into req.body.
  • Built directly into modern Express releases (express.json()).
Knowledge Check

How do you parse JSON request bodies natively in modern Express.js?