我在使用 Octokit 库设置 webhook 时遇到问题。
我从 Github 存储库中复制了示例:
const { Webhooks, createNodeMiddleware } = require("@octokit/webhooks");
const webhooks = new Webhooks({
secret: "development",
});
webhooks.onAny(({ id, name, payload }) => {
console.log(name, "event received");
});
require("http").createServer(createNodeMiddleware(webhooks)).listen(7777);
我在 Github 我看到以下错误:
{
"error": "Unknown route: POST /"
}