Skip to content

Instantly share code, notes, and snippets.

@Keith-Hon
Keith-Hon / gist:ed48526c3d9a249d5d56048df6172762
Created February 15, 2022 03:36
Github webhook handler for Next.js
// pages/api/webhooks/github.js
const { exec } = require("child_process");
const crypto = require("crypto");
// Handle GitHub Webhooks
export default function handler(req, res) {
try {
console.log("Incoming Request");
if (req.method !== 'POST') {
res.send(404);