We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fda61e3 commit bce56b4Copy full SHA for bce56b4
docs/patterns/websocket.md
@@ -222,20 +222,20 @@ Validate incoming WebSocket message.
222
By default Elysia will parse incoming stringified JSON message as Object for validation.
223
224
```typescript
225
-import { Elysia } from 'elysia'
+import { Elysia, t } from 'elysia'
226
227
const app = new Elysia()
228
.ws('/ws', {
229
// validate incoming message
230
body: t.Object({
231
message: t.String()
232
- })
+ }),
233
message(ws, { message }) {
234
ws.send({
235
message,
236
time: Date.now()
237
})
238
}
239
- )
+ })
240
.listen(8080)
241
```
0 commit comments