1、下載 body-parser 模塊 : npm install body-parser
2、require body-parser 模塊(引入),並用一個變量接收(此處栗子變量為 bodyparser)
3、將 bodyparser 注冊為中間件
const express = require('express') // 在此處 require body-parser 模塊
const bodyparser = require('body-parser') const app = express() app.listen(3001, () => console.log('app is running...')) // 在此處 use 這個 bodyparser 中間件
app.use(bodyparser.urlencoded({ extended: false }))