Files
root 9494f85b78
CI / schema-and-codegen (push) Failing after 29s
Initial commit
2026-06-20 03:54:40 -04:00

25 lines
670 B
JavaScript

import http from "node:http";
const port = Number(process.env.PORT ?? "9999");
const server = http.createServer((req, res) => {
if (req.method === "POST") {
let body = "";
req.on("data", (c) => {
body += c;
});
req.on("end", () => {
console.log(`[${new Date().toISOString()}] webhook ${body}`);
res.writeHead(200, { "Content-Type": "text/plain" });
res.end("ok");
});
return;
}
res.writeHead(200, { "Content-Type": "text/plain" });
res.end("POST JSON payloads from TLM bot webhooks here.");
});
server.listen(port, () => {
console.log(`Sample bot webhook receiver listening on http://127.0.0.1:${port}`);
});