-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
website/docs/guide/basic/mock.md
Outdated
|
||
## 处理请求数据 | ||
|
||
如果用户希望使用一些的中间件来处理请求的数据(`req` 对象),可以参考以下的示例代码: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果用户希望使用一些的中间件来处理请求的数据
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
bodyParser.json({ limit: '5mb', strict: false })(req, res, async () => { | ||
console.log(req.body); | ||
|
||
res.send({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释解释一下, 这个 req 和 res 的定义可以从哪里看到定义(外链也可)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加了类型
website/docs/guide/basic/mock.md
Outdated
|
||
```ts | ||
import bodyParser from 'body-parser'; | ||
import { Request, Response } from 'express'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import type {}
#541