```shell
npm i body-parser -s
```
app.js
```js
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }))
// parse application/json
app.use(bodyParser.json())
```
router.js
```js
router.post('/register', function (req, res) {
// 1. 获取表单提交的数据
// 2. 操作数据库
// 3. 发送响应
console.log(req.body);
})
```
