A getting started example when using the Pusher Node.JS HTTP API library with Express JS.
This repo gives you the absolute basics required to get started. It doesn't provide you with full examples so should be used as a quick getting started template or a reference.
From the directory you've cloned into, install the example dependencies:
$ npm install
Prior to running the Node app you'll need some environmental variables to be set.
PUSHER_APP_ID- your Pusher application ID
PUSHER_APP_KEY- your Pusher application key
PUSHER_APP_SECRET- your Pusher application secret
You can do this from the command line as part of running the application:
# Bash (OS X and Linux) PUSHER_APP_ID=YOUR_APP_ID PUSHER_APP_KEY=YOUR_APP_KEY PUSHER_APP_SECRET=YOUR_APP_SECRET node server.js # Windows command prompt: set PUSHER_APP_ID=YOUR_APP_ID&& set PUSHER_APP_KEY=YOUR_APP_KEY&& set PUSHER_APP_SECRET=YOUR_APP_SECRET&& node server.js # Windows PowerShell: $env:PUSHER_APP_ID="YOUR_APP_ID"; $env:PUSHER_APP_KEY="YOUR_APP_KEY"; $env:PUSHER_APP_SECRET="YOUR_APP_SECRET"; node server.js
Or, probably much more easily, with the help of foreman and by setting these values in a
PUSHER_CHAT_APP_ID=YOUR_APP_ID PUSHER_CHAT_APP_KEY=YOUR_APP_KEY PUSHER_CHAT_APP_SECRET=YOUR_APP_SECRET
$ foreman start
Make sure you've got the required environmental variables set up!