Created
November 7, 2016 20:13
-
-
Save joshuakarjala/d700e2c9259d856a0785b8d9f8d74a5f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 slackEvents = require('slack-events-listener')('<verificationToken>', onSlackEvent); | |
var bodyParser = require('body-parser'); | |
var app = require('express')(); | |
function onSlackEvent(event, cb) { | |
// do something. call cb with err if you want Slack to resend the message (your database might be down) | |
writeToDatabase(event, cb); | |
} | |
// /slack_events should match whatever webhook you set in Slack | |
app.use('/slack_events', bodyParser.json(), slackEvents); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment