Skip to content

Commit 54e94e3

Browse files
authored
style: fixed some grammar, rephrased sentences
- corrected some minor grammar issues - moved the text about configuration from the main heading to the configuration header. - rephrased some sentences --- The links used to link to bun's `readme.md` on their [github page](https://github.com/oven-sh/bun#websockets-with-bunserve) but recently they've created a website for their documentation. I am not sure what it should link to; would https://bun.sh/docs/api/websockets#create-a-websocket-server work?
1 parent ecd8131 commit 54e94e3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/patterns/websocket.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ head:
1515
---
1616

1717
# WebSocket
18-
Elysia WebSocket is extending Bun WebSocket which use [uWebSocket](https://github.com/uNetworking/uWebSockets) under the hood.
18+
Elysia WebSocket extends Bun's WebSocket which uses [uWebSocket](https://github.com/uNetworking/uWebSockets) under the hood.
1919

20-
To start using WebSocket, register the WebSocket plugin, and start declaring WebSocket route with `.ws`.
20+
To start working with a WebSocket, register the Elysia WebSocket plugin, and declare a WebSocket route with `.ws`.
2121
```typescript
2222
import { Elysia, ws } from 'elysia'
2323

@@ -31,14 +31,14 @@ new Elysia()
3131
.listen(8080)
3232
```
3333

34-
WebSocket route is extending Bun WebSocket configuration, for additional configuration please refers to [Bun's WebSocket](https://bun.sh/docs/api/websockets).
3534

36-
Just like normal route, WebSocket also accepts **schema** to strictly type and validate requests.
35+
Just like normal route, WebSockets also accepts a **schema** object to strictly type and validate requests.
3736

3837
## Configuration
39-
This plugin extends config from [Bun WebSocket](https://github.com/oven-sh/bun#websockets-with-bunserve)
4038

41-
Below is a config extends from [Bun WebSocket](https://github.com/oven-sh/bun#websockets-with-bunserve)
39+
Elysia's WebSocket plugin extends Bun's WebSocket configuration so if you wish to configure the websocket you can refer to [Bun's WebSocket documentation](https://bun.sh/docs/api/websockets) to learn more about this.
40+
41+
Below is a config that extends from [Bun WebSocket](https://github.com/oven-sh/bun#websockets-with-bunserve)
4242

4343
### perMessageDeflate
4444
@default `false`
@@ -65,11 +65,11 @@ The maximum number of bytes that can be buffered for a single connection.
6565

6666
Close the connection if the backpressure limit is reached.
6767

68-
## Method
69-
Below are the new methods register by the plugin
68+
## Methods
69+
Below are the new methods that are available to the WebSocket plugin
7070

7171
## ws
72-
Create websocket handler
72+
Create a websocket handler
7373

7474
Example:
7575
```typescript

0 commit comments

Comments
 (0)