req.body is undefined mean app

前端 未结 1 479
鱼传尺愫
鱼传尺愫 2021-01-25 04:06

I have an issue on my app. The simple way to tell you whats the problem let mme show you my code

var Meetup = require(\'./models/meetup\');



module.exports.cre         


        
1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-25 04:45

    If req.body is undefined then you need to:

    • make sure you use the body-parser on the backend
    • make sure you pass the correct data on the frontend
    • make sure that the data passed by your frontend is in the correct place (body)
    • make sure that the data is in the correct format (JSON? URL-encoded?)
    • open the Network tab in the developer console of your browser and see what is transferred

    See one of the answers to your own questions for more details:

    • schema error mean app

    0 讨论(0)
提交回复
热议问题