Skip to content

Commit bce56b4

Browse files
authored
docs: fix codeblock in WebSocket message validation
1 parent fda61e3 commit bce56b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/patterns/websocket.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,20 +222,20 @@ Validate incoming WebSocket message.
222222
By default Elysia will parse incoming stringified JSON message as Object for validation.
223223

224224
```typescript
225-
import { Elysia } from 'elysia'
225+
import { Elysia, t } from 'elysia'
226226

227227
const app = new Elysia()
228228
.ws('/ws', {
229229
// validate incoming message
230230
body: t.Object({
231231
message: t.String()
232-
})
232+
}),
233233
message(ws, { message }) {
234234
ws.send({
235235
message,
236236
time: Date.now()
237237
})
238238
}
239-
)
239+
})
240240
.listen(8080)
241241
```

0 commit comments

Comments
 (0)