Skip to content

Commit 920f9fb

Browse files
mythzCopilot
andcommitted
Add docs
Co-authored-by: Copilot <copilot@github.com>
1 parent cc1b204 commit 920f9fb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

MyApp/_pages/server-events.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,21 @@ real-time communications to all clients subscribed to the same ServiceStack Inst
7878
Like most other [modular functionality](/plugins) in ServiceStack, Server Sent Events is encapsulated in a single Plugin that can be registered in your AppHost with:
7979

8080
```csharp
81-
Plugins.Add(new ServerEventsFeature());
81+
public class ConfigureServerEvents : IHostingStartup
82+
{
83+
public void Configure(IWebHostBuilder builder) => builder
84+
.ConfigureServices(services => {
85+
services.AddPlugin(new ServerEventsFeature());
86+
});
87+
}
8288
```
8389

90+
This can be added to your Project with:
91+
92+
:::sh
93+
npx add-in serverevents
94+
:::
95+
8496
The registration above is all that's needed for most use-cases which just uses the defaults below:
8597

8698
```csharp

0 commit comments

Comments
 (0)