Express.js req.body undefined

前端 未结 30 2520
半阙折子戏
半阙折子戏 2020-11-22 12:02

I have this as configuration of my Express server

app.use(app.router); 
app.use(express.cookieParser());
app.use(express.session({ secret: \"keyboard cat\" }         


        
30条回答
  •  遇见更好的自我
    2020-11-22 12:43

    No. You need to use app.use(express.bodyParser()) before app.use(app.router). In fact, app.use(app.router) should be the last thing you call.

提交回复
热议问题