Skip to content

Commit 978a808

Browse files
authored
Fix: improve grammar and correct typos in playground (#659)
1 parent 8a2ab5b commit 978a808

File tree

2 files changed

+11
-11
lines changed
  • docs/tutorial/getting-started

2 files changed

+11
-11
lines changed

docs/tutorial/getting-started/handler-and-context/data.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ new Elysia()
1010
export const testcases = [
1111
{
1212
title: 'Create POST endpoint',
13-
description: 'Let\'s a POST endpoint "/", so we can send a body',
13+
description: 'Let\'s create a POST endpoint "/", so we can send a body',
1414
test: {
1515
request: {
1616
method: 'POST',
@@ -23,7 +23,7 @@ export const testcases = [
2323
},
2424
{
2525
title: 'Extract Body',
26-
description: "Let's extract a body a return it as `return { body }`",
26+
description: "Let's extract a body and return it as `return { body }`",
2727
test: {
2828
request: {
2929
method: 'POST',
@@ -45,7 +45,7 @@ export const testcases = [
4545
{
4646
title: 'Extract Query',
4747
description:
48-
"Let's extract a query a return it as `return { body, query }`",
48+
"Let's extract a query and return it as `return { body, query }`",
4949
test: {
5050
request: {
5151
method: 'POST',
@@ -64,7 +64,7 @@ export const testcases = [
6464
{
6565
title: 'Extract Headers',
6666
description:
67-
"Let's extract a header a return it as `return { body, query, headers }`",
67+
"Let's extract a header and return it as `return { body, query, headers }`",
6868
test: {
6969
request: {
7070
method: 'POST',

docs/tutorial/getting-started/status-and-headers/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ import { code, testcases } from './data'
2929

3030
# Status
3131

32-
Status code is an indicator of how server handle the request.
32+
Status code is an indicator of how the server handles the request.
3333

3434
You must have heard of the infamous **404 Not Found** when you visit a non-existing page.
3535

3636
That's a **status code**.
3737

38-
By default, Elysia will return **200 OK** for successful request.
38+
By default, Elysia will return **200 OK** for a successful request.
3939

4040
Elysia also returns many other status codes depending on the situation like:
4141
- 400 Bad Request
4242
- 422 Unprocessable Entity
4343
- 500 Internal Server Error
4444

45-
You can also return a status code by return your response in a `status` function.
45+
You can also return a status code by returning your response using a `status` function.
4646

4747
```typescript
4848
import { Elysia } from 'elysia'
@@ -55,7 +55,8 @@ new Elysia()
5555
See <DocLink href="/essential/handler#status">Status</DocLink>.
5656

5757
## Redirect
58-
Similarly, you can also redirect the request to another URL returning a `redirect` function.
58+
59+
Similarly, you can also redirect the request to another URL by returning a `redirect` function.
5960

6061
```typescript
6162
import { Elysia } from 'elysia'
@@ -68,9 +69,8 @@ new Elysia()
6869
See <DocLink href="/essential/handler#redirect">Redirect</DocLink>.
6970

7071
## Headers
71-
Unlike, status code, and redirect where you can return directly.
7272

73-
It's likely that you might set headers multiple times in your application.
73+
Unlike status code and redirect, which you can return directly, you might need to set headers multiple times in your application.
7474

7575
That's why instead of returning a `headers` function, Elysia provides a `set.headers` object to set headers.
7676

@@ -86,7 +86,7 @@ new Elysia()
8686
.listen(3000)
8787
```
8888

89-
Because `headers` is a **request headers**, Elysia distinguish between request headers and response headers by prefixing **set.headers** for response.
89+
Because `headers` represents **request headers**, Elysia distinguishes between request headers and response headers by prefixing **set.headers** for response.
9090

9191
See <DocLink href="/essential/handler#set-headers">Headers</DocLink>.
9292

0 commit comments

Comments
 (0)