javascript - If node module `body-parser` is not safe, what is the next solution? -
javascript - If node module `body-parser` is not safe, what is the next solution? -
i read post on body-parser in node.js , claimed not safe.
if i'm not utilize body-parser middleware in project, solution should utilize ensure safety?
do not utilize bodyparser express.js
body-parser deprecation message
i'm newbie on node.js if solution provided examples, i'll appreciate!
thx in advance!
the solution provided in article linked to.
avoid bodyparser , explicitly utilize middleware needif want parse json in endpoint, utilize express.json() middleware. if want json , urlencoded endpoint, utilize [express.json(), express.urlencoded()] middleware.
if want users upload files endpoint, utilize express.multipart() , sure clean temp files created. still stuffer [sic] problem #3 mentioned.
note in express 4, these middlewares no longer packaged express. available via body-parser package, json , urlencoded properties. recommend other packages multipart uploads.
javascript node.js
Comments
Post a Comment