Skip to content

Instantly share code, notes, and snippets.

@Deborah-Digges
Last active January 28, 2020 19:27
Show Gist options
  • Save Deborah-Digges/fe5de21f3c8c5b3cf93cca7eb934f002 to your computer and use it in GitHub Desktop.
Save Deborah-Digges/fe5de21f3c8c5b3cf93cca7eb934f002 to your computer and use it in GitHub Desktop.
const express = require('express')
const app = express()
const port = 3000
const bodyParser = require('body-parser');
var options = {
type: 'application/json'
};
app.use(bodyParser.raw(options));
app.post('/', (req, res) => {
console.log(req.headers);
console.log(req.body.toString())
res.send('Hello World!')
})
app.listen(port, () => console.log(`Example app listening on port ${port}!`))
@Deborah-Digges
Copy link
Author

Instructions to test the webhook:

1. `npm install express`
2. `npm install body-parser`
3. `node server.js`
4. In a separate terminal -> `ngrok http 3000`
5. Copy the https link outputted from ngrok to paste into the http webform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment