https://files-cdn.cnblogs.com/files/yummylucky/zhifu.bmp

支付宝

https://files-cdn.cnblogs.com/files/yummylucky/WeChat.bmp

微 信

body-parser 用法

 

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

 

posted @ 2019-03-05 21:59  kiss雪夜  阅读(6093)  评论(0编辑  收藏  举报