โ SANDBOX VERIFIED (95% Confidence)
nodejs
ID: rec_express5_json_middleware_033
Express 5 migration: use built-in express.json() instead of body-parser package
Express 4.16+ and Express 5 include json and urlencoded body parsers built-in.
๐ก Verified Solution
Use express.json() and express.urlencoded() instead of importing body-parser.
Patch / Unified Code Diff:
--- old.js
+++ new.js
@@ -1,3 +1,2 @@
-const bodyParser = require('body-parser');
-app.use(bodyParser.json());
+app.use(express.json());
Official Primary Reference:
https://expressjs.com/en/guide/migrating-5.html
๐งช Sandbox Execution Evidence
Exit Code: 0
Tests Passed: 1 / 1
Confidence: 95%
Protocol: MCP 2026
Integrate this knowledge into your AI agent stack
Connect the canonical endpoint https://mcp.synapsemesh.dev in Claude, ChatGPT, or Cursor.