You might use kue in your application to run jobs in the background. kue-ui-express provides a nice UI to monitor those jobs. This example is a ready to go monitoring app which can be deployed to Heroku easily.
It uses kue-ui-express
, basic-auth
and redis
!
Clone repository locally:
$ git clone git@github.com:zauberware/node-kue-express-ui-heroku-example.git && cd node-kue-express-ui-heroku-example
.
Install dependencies:
$ npm install
.
Setup environment variables:
Copy .env.sample
to .env
. Your .env
should look like:
REDIS_URL=redis://localhost:6379
USERNAME=user
PASSWORD=password
PORT=5001
Open a terminal window and be sure that you run a redis server. Start server:
$ redis-server
Start server:
$ npm start
or
$ babel-node start-server.js
or with Procfile and heroku-local
cli feature:
$ heroku local
Or manually:
- Create a new app on heroku.
- Add Heroku Redis or RedisToGo. (If you use RedisToGo you have to change the ENV var in the script.) Note that this app is only the monitoring application. If you have a existing Redis isntance you have to set the link oni the REDIS_URL env var.
- Be sure all environment variables are set on heroku
- Add heroku as a remote repository
- Push to master and deploy the app
To secure the connection between redis and your dynos you have setup the Stunnel Buildpack. Read more here https://devcenter.heroku.com/articles/securing-heroku-redis
Installation instruction for buildkit: https://github.com/heroku/heroku-buildpack-redis
See our branch tunnel
and see the changes in Procfile
and Procfile.dev
https://github.com/zauberware/node-kue-express-ui-heroku-example/tree/tunnel