Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Formspree Webhook Example

node v8.17.0
version: 1.0.0
endpointsharetweet
require("isomorphic-fetch") exports.endpoint = function(req, res) { let url = req.url; if (url === '/hook') { // Step 1: Confirm the subscription this request // includes an X-Hook-Secret let hook_secret = req.headers["x-hook-secret"] if (hook_secret) { res.setHeader("x-hook-secret", hook_secret) res.end(); } else { // Step 1: Confirm the subscription this request // includes an X-Hook-Secret console.log("Received webhook!") // This is a webhook! fetch("cc2742b8.ngrok.com") res.end() } } else { res.end(url + "\n"); } }
Loading…

no comments

    sign in to comment