首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Github创建- Probot -app:“无法发布/”(404)对web钩子请求的响应

Github创建- Probot -app:“无法发布/”(404)对web钩子请求的响应
EN

Stack Overflow用户
提问于 2021-12-23 21:08:07
回答 2查看 246关注 0票数 0

测试npx probot-app;在每个启动程序中尝试,并且存在相同的问题。

我创建、构建和运行该应用程序,然后在github上配置和安装该应用程序,我能够接收web钩子事件,但我看到我的本地应用程序响应了404。

smee接收到事件

代码语言:javascript
复制
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:

代码语言:javascript
复制
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正在发送一个web钩子,smee正在接收它,但是我的本地应用程序是404:无法发布/

由于似乎是路由问题,无法获得示例应用程序来处理web钩子事件。以前有人遇到过这种事吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-01-03 22:12:53

确保您没有在端口3000上运行任何其他应用程序。默认使用3000,并可能导致您所描述的错误。

票数 0
EN

Stack Overflow用户

发布于 2021-12-24 19:14:59

其中一个可能的原因可能是您的GitHub应用程序没有采取该操作的权限。您的GitHub应用程序是否可能缺少“问题”特权设置?(https://docs.github.com/en/rest/reference/permissions-required-for-github-apps#permission-on-issues)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70467380

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档