// Node.js express server example
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const port = 3000
const mySecretKey = "..."
app.use(bodyParser.json())
app.post('/webhook-path', (request, response) => {
const data = request.body;
// CHECK SECRET KEY
if (data.secret !== mySecretKey) {
return res.end()
}
// PROCESS EVENT HERE & SEND OK RESPONSE
response.send("OK")
})
app.listen(port, () => console.log(`Server listening on port ${port}`))