docs: improve grammar (#362)

This commit is contained in:
Tamal H
2022-07-04 11:21:47 +00:00
committed by GitHub
parent 9e75a5c065
commit fcff570fc1
9 changed files with 17 additions and 17 deletions
+3 -3
View File
@@ -9,11 +9,11 @@ now, only the page component has been discussed in this chapter.
Handlers are functions in the form of `Request => Response` or
`Request => Promise<Response>` that are called when a request is made to a
particular route. There can be one handler that covers all HTTP methods, or one
particular route. There can be one handler that covers all HTTP methods or one
handler per method.
The handler has access to the `Request` object that backs the request to the
route, and must return a `Response` object. The response object can either be
route and must return a `Response` object. The response object can either be
created manually (for example a JSON response for an API route), or it can be
created by rendering the page component. By default, all routes that don't
define a custom handler use a default handler that just renders the page
@@ -21,7 +21,7 @@ component.
To define a handler in a route module, one must export it as a named export with
the name `handler`. Handlers can have two forms: a plain function (catchall for
all HTTP methods), or a plain object where each property is a function named by
all HTTP methods) or a plain object where each property is a function named by
the HTTP method it handles.
Here is an example of a custom `GET` handler that renders the page component and