https://github.com/tamdilip/sse-nest-js
Sample Nest JS app to test Server-Sent Events (SSE) to push notifications to UI from API layer without Websockets.
https://github.com/tamdilip/sse-nest-js
corn-job java nestjs nodejs notifications server-sent-events server-side-events sse websocket
Last synced: 2 months ago
JSON representation
Sample Nest JS app to test Server-Sent Events (SSE) to push notifications to UI from API layer without Websockets.
- Host: GitHub
- URL: https://github.com/tamdilip/sse-nest-js
- Owner: tamdilip
- Created: 2023-10-11T13:48:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-13T16:44:12.000Z (over 2 years ago)
- Last Synced: 2025-09-10T07:39:17.941Z (10 months ago)
- Topics: corn-job, java, nestjs, nodejs, notifications, server-sent-events, server-side-events, sse, websocket
- Language: TypeScript
- Homepage: https://sse-nest-js.onrender.com/?userId=2
- Size: 357 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🔔 sse-nest-js
[](https://sse-nest-js.onrender.com/?userId=2)
[](https://gitpod.io/#https://github.com/tamdilip/sse-nest-js)
Sample Nest JS app to test Server-Sent Events (SSE) to push unidirectional notifications to UI from API layer without Websockets.
- UI will subscribe to the Server-Sent Events (SSE) endpoint on the NestJS layer on page load for the specified user id in URL (`?userId=2`).
- A `corn scheduler` is setup on the Nest JS layer for every `2 seconds` which will emit message to a random user id.
- The SSE connection will be destroyed on page unload.
## Local setup
```
$ git clone https://github.com/tamdilip/sse-nest-js.git
$ cd sse-nest-js
$ npm start
$ Visit in Browser -> http://localhost:3000/?userId=2
```
## Screenshot
