Skip to content

Commit

Permalink
docs: add example code to websockets section
Browse files Browse the repository at this point in the history
  • Loading branch information
Papooch committed Aug 6, 2024
1 parent bd18f3e commit f5def38
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/docs/05_considerations/02_compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ Below are listed transports with which it is confirmed to work:
### Websockets

_Websocket Gateways_ don't respect globally bound enhancers, therefore it is required to bind the `ClsGuard` or `ClsInterceptor` manually on the `WebsocketGateway`. Special care is also needed for the `handleConnection` method (See [#8](https://github.com/Papooch/nestjs-cls/issues/8))

```ts
@WebSocketGateway()
// highlight-start
@UseInterceptors(ClsInterceptor)
// highlight-end
export class Gateway {
// ...
}
```
9 changes: 9 additions & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ const config = {
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'NestJS Documentation',
href: 'https://docs.nestjs.com/',
},
],
},
{
title: 'Community',
items: [
Expand Down

0 comments on commit f5def38

Please sign in to comment.