Simple Webhook Server
The snippet can be accessed without any authentication.
Authored by
Alexander Bazo
import express from "express";
import { execFileSync } from "child_process";
const app = express();
app.get("/", (request, response) => {
try {
const output = execFileSync(process.env.npm_package_config_script, [], {
stdio: "pipe",
encoding: "utf-8",
});
response.status(200).send("OK");
} catch (error) {
console.log(error);
response.status(501).send("Error while processing webhook");
}
});
app.listen(process.env.npm_package_config_port);
Please register or sign in to comment