mirror of
https://github.com/ralscha/sse-spring-demo2.git
synced 2026-10-09 12:18:24 +02:00
springsse demo
- Java 54%
- TypeScript 23.3%
- HTML 12.5%
- CSS 10.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .mvn/wrapper | ||
| client | ||
| src/main/java/com/example/demo | ||
| .gitignore | ||
| mvnw | ||
| mvnw.cmd | ||
| pom.xml | ||
| README.md | ||
Spring Boot SSE Demo
Small demo that streams server-sent events from Spring Boot to an Angular client.
Requirements
- Java 21 or newer
- Node.js with npm
Run the backend
./mvnw spring-boot:run
On Windows PowerShell:
.\mvnw.cmd spring-boot:run
The backend starts on http://localhost:8080 and exposes:
GET /register/{clientId}as an SSE stream
The scheduled demo publisher sends progress and event messages to client1 every five seconds. The backend also sends SSE heartbeat comments every 15 seconds so idle infrastructure is less likely to close the stream.
Run the Angular client
cd client
npm install
npm start
Open http://localhost:4200. The client subscribes to:
http://localhost:8080/register/client1
Verify
./mvnw test
cd client
npm run build
npm audit --omit=dev currently reports no production vulnerabilities. Remaining full-audit findings are in Angular build tooling.