Skip to content

Instantly share code, notes, and snippets.

View frehner's full-sized avatar
🐽
hi

Anthony Frehner frehner

🐽
hi
View GitHub Profile
@joshbeckman
joshbeckman / index.js
Created October 10, 2015 17:37
An example Node.js server that can verify a Shopify webhook's integrity. Run with `node index.js`.
const PORT = 3000;
const SECRET = 'APP_SHARED_SECRET';
var http = require('http'),
crypto = require('crypto'),
server;
function verifyShopifyHook(req) {
var digest = crypto.createHmac('SHA256', SECRET)
.update(new Buffer(req.body, 'utf8'))