Created
June 25, 2020 11:48
-
-
Save velotiotech/6f5b0f6407c0a74a0bce4b398a849410 to your computer and use it in GitHub Desktop.
Snippet from node app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Pusher = require('pusher'); | |
var pusher = new Pusher({ | |
appId: 'APP_ID', | |
key: 'APP_KEY', | |
secret: 'APP_SECRET', | |
cluster: 'APP_CLUSTER' | |
}); | |
// Logic which will then trigger events to a channel | |
function trigger(){ | |
... | |
... | |
pusher.trigger('my-channel', 'my-event', {"message": "hello world"}); | |
... | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment