Simple push notification manager I can implement in my apps. Yay.
Add port
to environment variables to override default port 8080
Be sure to use a topic others won't guess.
-
GET
/get-public-vapid-key
returns{data: "KEY"}
-
POST
/subscribe
returns{status: 200}
if done right. Provide a JSON body with the following:{topic: "my-topic-name", subscription: {JS subscription object, see frontend/index.html}}
-
GET
/send-notification
with query paramstopic: string
,title: string
,body: string
, and optionallyat: ISO date string
-
GET
/get-notifications
with query paramstopic: string
returns all push notifications -
GET
/remove-notification/
with query paramid: string
(ID of the notification)