Skip to content
/ WebPush Public

A web push notification example with node js + react ts

Notifications You must be signed in to change notification settings

h110m/WebPush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebPush

A web push notification example with node js + react ts that runs on Chrome and Firefox



Setup

Please change the port in the index.js file (default to 80)


One-line-command

git clone https://github.com/h110m/WebPush . && npm i && cd web && npm i && npm run build && cd .. && npm start

Step-by-step

Clone the repo with

git clone https://github.com/h110m/WebPush .

Install the dependencies for the backend with

npm install

Go in the frontend folder and install the dependencies with

cd web && npm install

Build the frontend with

npm run build

Go outside the web folder and start the backend with

cd .. && npm start


How to use

You can just go to http://localhost:80 to access the website and register a webworker for your notifications. When the registration is successfull you will get an ID that you can use to make a GET request to http://localhost:80/sub/{ID} which will send a predefined hardcoded message to the device with the given ID

About this project

Well... uhm... i was just tinkering around with the web push notification api and "accidentally" wrote a neat little example on how to use the web push notification api.

Have fun tinkering with it ^-^

About me

Made with

About

A web push notification example with node js + react ts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published