摘要: 自定义中间件为模块代码如下: // custom-body-parser.js const qs = require('querystring') const bodyParser = (req, res, next) => { // 定义中间价具体的业务逻辑 // 1. 定义一个 str 字符串, 阅读全文
posted @ 2020-08-24 21:30 彬戈戎马 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 自定义中间件: // 导入express模块 const express = require('express') // 创建express的服务器实例 const app = express() // 1. 导入自己封装的中间件模块 const customBodyParser = require 阅读全文
posted @ 2020-08-24 21:27 彬戈戎马 阅读(181) 评论(0) 推荐(0) 编辑