https://github.com/pjsier/push-page-diff
Cloudflare Worker for subscribing to a browser push notification when an HTML page's content changes
https://github.com/pjsier/push-page-diff
cloudflare cloudflare-workers rust wasm web-push
Last synced: 4 months ago
JSON representation
Cloudflare Worker for subscribing to a browser push notification when an HTML page's content changes
- Host: GitHub
- URL: https://github.com/pjsier/push-page-diff
- Owner: pjsier
- License: mit
- Created: 2021-01-02T00:02:51.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-09T03:10:44.000Z (almost 5 years ago)
- Last Synced: 2024-12-21T23:25:17.795Z (about 1 year ago)
- Topics: cloudflare, cloudflare-workers, rust, wasm, web-push
- Language: Rust
- Homepage: https://push-page-diff.pjsier.workers.dev/
- Size: 263 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Page Diff Push Notifications
[](https://github.com/pjsier/push-page-diff/actions?query=workflow%3ACICD)
[Cloudflare Worker](https://workers.cloudflare.com/) for subscribing to a browser push notification when an HTML page's content changes. You can see the live version at [push-page-diff.pjsier.workers.dev](https://push-page-diff.pjsier.workers.dev/).
Includes workarounds for customizing a webpack build in a Cloudflare Worker using Rust. Also includes a WASM-compatible setup for web push authentication and encryption.
## Setup
You'll need Rust, node.js, and wrangler installed. You'll need to replace the account-specific values in `wrangler.toml` with your own. Install dependencies with:
```
npm install
```
Then you'll need to generate keys for VAPID authentication by running:
```
npm run keys
```
Then copy `.env.sample` to `.env` and fill in the output values for `VAPID_PUBLIC_KEY` and `VAPID_PRIVATE_KEY`. `VAPID_SUBJECT` should be a `mailto:` link to an email of your choice.
Run the worker locally at [localhost:8787](http://localhost:8787) with:
```
wrangler dev
```