An implementation of server-sent events for Universis api server based on Server-sent events specification
npm i @universis/sse
Register ServerSideEventService
under services
section of application services:
{
"services": [
...,
{
"serviceType": "@universis/sse#ServerSentEventService",
"strategyType": "@universis/sse#DefaultServerSentEventService"
}
]
Configure ServerSideEventService
under settings/universis/sse
section:
{
"settings": {
"universis": {
...
"sse": {
"expirationTimeout": 20
}
}
}
}
The expirationTimeout
defines the duration of a server-side event client in minutes. The default value is 20 minutes.