测试 npx create-probot-app;尝试了每个启动器,并且存在相同的问题。
我创建、构建和运行应用程序,然后在 github 上配置和安装应用程序,我能够接收 webhook 事件,但我看到我的本地应用程序以 404 响应。
error: Error: cannot POST / (404)
ERROR (server): Not Found
Error: Not Found
at Request.callback (/Users/X/Projects/Y/compiler/githubapp/x-bot/node_modules/superagent/lib/node/index.js:884:15)
at IncomingMessage.<anonymous> (/Users/X/Projects/Y/compiler/githubapp/x-bot/node_modules/superagent/lib/node/index.js:1127:20)
at IncomingMessage.emit (events.js:326:22)
at IncomingMessage.EventEmitter.emit (domain.js:483:12)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
status: 404
我的 index.ts:
export = (app: Probot) => {
app.on("issues.opened", async (context) => {
const issueComment = context.issue({
body: "Thanks for opening this issue!",
});
await context.octokit.issues.createComment(issueComment);
});
// For more information on building apps:
// https://probot.github.io/docs/
// To get your app running against GitHub, see:
// https://probot.github.io/docs/development/
};
我检查了我的环境变量似乎在 .env 中设置正确
总之,github正在发送一个webhook,smee正在接收它,但我的本地应用程序响应404:无法发布/
由于似乎是路由问题,无法让示例应用程序处理 webhook 事件。有人遇到过这个吗?