https://github.com/naturalprogrammer/webpush-java-demo
WebPush Java Demo with Spring Boot
https://github.com/naturalprogrammer/webpush-java-demo
Last synced: 7 months ago
JSON representation
WebPush Java Demo with Spring Boot
- Host: GitHub
- URL: https://github.com/naturalprogrammer/webpush-java-demo
- Owner: naturalprogrammer
- License: other
- Created: 2017-12-09T14:28:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-09T15:27:40.000Z (over 8 years ago)
- Last Synced: 2025-04-08T15:49:31.644Z (about 1 year ago)
- Language: JavaScript
- Size: 155 KB
- Stars: 21
- Watchers: 1
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Java WebPush Demo application
* Java WebPush demo
* https://github.com/web-push-libs/webpush-java used
* Front-end copied from https://github.com/thihara/web_push_notifications/tree/master/static
* Spring Boot is used for creating the backend
## Try it out
* Checkout and run the application
* Visit http://localhost:8080 and then click on subscribe
* Post a notification by using the following command from linux/mac (or a git-bash terminal in Windows):
```
curl -X POST \
http://localhost:8080/notify-all \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"title": "NaturalProgrammer",
"message": "NaturalProgmmer.com - where quality matters",
"clickTarget": "http://www.naturalprogrammer.com"
}'
```
## References
* https://dzone.com/articles/web-push-notifications-1
* https://github.com/web-push-libs/webpush-java
* https://github.com/web-push-libs/webpush-java/blob/master/doc/UsageExample.md
* https://github.com/web-push-libs/webpush-java/blob/master/doc/VAPID.md