A tiny push notification app
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
client
server
test
.env
.gitignore
.travis.yml
LICENSE
README.md
generateKeys.js
index.js
package.json

README.md

nanopush Build Status

A tiny push notification app.

Setup

nanopush requires at least node v6.

npm install
cp .env .env.local
node generateKeys.js >> .env.local

Edit .env.local and fill in your email for SERVICE_OWNER_EMAIL. Then to start the app, run:

npm start

Testing

npm test

Deployment

This needs to be deployed and proxied on https, or else the push API won't work. I suggest Caddy or nginx.

Once you have all that set up, you can start the app in production mode like so

# Set these environment variables how you like
export VAPID_PUBLIC_KEY={the public key you generated earlier in .env.local}
export VAPID_PRIVATE_KEY={the private key you generated earlier in .env.local}
export SERVICE_OWNER_EMAIL={your email}

export HOST=0.0.0.0 # Default: 127.0.0.1
export PORT=8080 # Default: 3000

node index.js

I use a pm2 config to keep the app always running.