需要在启动服务的时候,添加中间件
var
bodyParser
=
require
(
'body-parser'
);
app
.
use
(
bodyParser
.
urlencoded
({
extended:
false
}))
app
.
use
(
bodyParser
.
json
())