未验证 提交 532a5bcc 编写于 作者: B Balázs Orbán 提交者: GitHub

Fix grammar in API routes: Introduction (#19385)

For an API route to work, you need to `export as default a function` (a.k.a **request handler**), which then receives the following parameters:
For an API route to work, you need to `export a function as default` (a.k.a **request handler**), which then receives the following parameters:


I might be wrong though (not a native English speaker), it just sounds strange to my ears.
上级 d82a6057
......@@ -29,7 +29,7 @@ export default function handler(req, res) {
}
```
For an API route to work, you need to export as default a function (a.k.a **request handler**), which then receives the following parameters:
For an API route to work, you need to export a function as default (a.k.a **request handler**), which then receives the following parameters:
- `req`: An instance of [http.IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessage), plus some pre-built middlewares you can see [here](/docs/api-routes/api-middlewares.md)
- `res`: An instance of [http.ServerResponse](https://nodejs.org/api/http.html#http_class_http_serverresponse), plus some helper functions you can see [here](/docs/api-routes/response-helpers.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册