【问题标题】:Nodejs Github api gist create - receiving Socket Hang upNodejs Github api gist create - 接收 Socket 挂断
【发布时间】:2012-07-19 16:23:25
【问题描述】:

我正在尝试通过 github api 创建 Gist - 使用 npm 模块“github”(https://github.com/ajaxorg/node-github/)

我有这个代码

  var gh = new GitHubApi({
    version: "3.0.0"
  });

  gh.authenticate({
    type: "oauth",
    token: data.token
  });

  gh.user.get({}, function (err, data) {
    console.log(err);
    console.log(data);

    var blob = {};
    blob.repo = commitData.repo;
    blob.user = commitData.user;
    blob.content = commitData.content;
    blob.encoding = commitData.encoding;
        gh.gitdata.createBlob(blob, function (err, blob) {
           console.log(err);
           console.log(blob);
           cb('failed');
       });
  });

问题是 createBlob 函数正在接收这个

{ 
  defaultMessage: 'Internal Server Error',
  message: 'socket hang up',
  code: '500' 
}

我在 heroku 免费实例上运行我的应用程序(它基于 express)。

非常感谢,我解决了几天仍然无法正常工作。

【问题讨论】:

    标签: node.js github github-api


    【解决方案1】:

    也许 api.github.com 出现了一些中断?

    奇怪,但 status.github.com report for Jul 19 表明当时一切都还好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-15
      • 2010-12-31
      • 2021-05-28
      • 2017-11-09
      • 2019-08-02
      • 2013-09-11
      • 2019-05-08
      相关资源
      最近更新 更多