gpt4 book ai didi

javascript - 无法让 gitHub API 在 javascript 中工作。特别是 gitdata.getCommit

转载 作者:行者123 更新时间:2023-11-30 05:37:49 24 4
gpt4 key购买 nike

var GitHubApi = require("github");

var github = new GitHubApi({
// required
version: "3.0.0",
// optional
debug: true,
protocol: "https",
host: "github.com",
//pathPrefix: "/joyent/node", // for some GHEs
timeout: 5000
});
github.gitdata.getCommit({
user: "bnoordhuis",
repo: "/joyent/node",
sha: "c30cc4e3a5ead3ca5b48e8eec445740775888ed8"
}, function(err, res) {
console.log(JSON.stringify(res));
});

我发布了上面的代码。我在github中随机找了一个分支进行测试。我还发现了一个随机用户以及该用户的随机提交。我在这里阅读了有关 API 的信息:http://mikedeboer.github.io/node-github/#gitdata.prototype.getCommit

当我运行上面的代码时,我得到错误代码 404,null bnoordhuis未定义

任何帮助都会很棒!我是 github api 的新手。

这是我尝试使用的存储库:https://github.com/joyent/node/

最佳答案

您的存储库应该只是“节点”。 Joyent 是用户。

关于javascript - 无法让 gitHub API 在 javascript 中工作。特别是 gitdata.getCommit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22506972/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com