https://github.com/spyna/push-notification-demo
How to implement Web Push Notifications with live demo and instructions
https://github.com/spyna/push-notification-demo
Last synced: 9 months ago
JSON representation
How to implement Web Push Notifications with live demo and instructions
- Host: GitHub
- URL: https://github.com/spyna/push-notification-demo
- Owner: Spyna
- License: mit
- Created: 2019-08-26T10:30:28.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T04:34:47.000Z (over 3 years ago)
- Last Synced: 2025-05-20T14:07:08.065Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://push-notifications-demo.netlify.app/
- Size: 2.5 MB
- Stars: 217
- Watchers: 10
- Forks: 94
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> How to implement Web Push Notifications with live demo and instructions: https://push-notifications-demo.netlify.app/
![A push notificatin][pushNotificaiton]
[pushNotificaiton]: https://github.com/Spyna/push-notification-demo/raw/master/push-notification.jpg "Push notification"
# push-notification-demo
This mono-repo project is a demo for this article https://itnext.io/an-introduction-to-web-push-notifications-in-javascript-a701783917ce
The project is composed by two parts:
* a front end written is HTML + JavaScript
* a back end written in JavaScript + NodeJS
## Run locally
### font-end
```
cd front-end
npm install
npm start
```
Next, open http://localhost:9000.
### back-end
```
cd back-end
npm install
export CORS_ORIGIN=http://localhost:9000 && node src/server.js
```
`export CORS_ORIGIN=http://localhost:9000` means: accept Cross Origin call from this host.
## deploying to your server
If you want to deploy the front-end to your server remember to modify the back-end host in the webpack config file: `webpack.config.prod.js`: `'process.env.PUSH_SERVER_URL': JSON.stringify('https://push-notification-demo-server.herokuapp.com'),`
[](https://github.com/igrigorik/ga-beacon)