且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在node.js项目中保存mongodb中的记录?

更新时间:2022-12-07 19:50:06

此代码修复了这种情况:

This code fixed the situation:
app.use(bodyParser.urlencoded({ extended: true }));



req.body.task undefined 直到 extended 设置为 true 以支持URL编码的主体。


req.body.task was undefined until extended was set to true to support URL-encoded bodies.