```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);
})
```