2014-03-19 20 views
2
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無法讓gitHub API在JavaScript中工作。具體gitdata.getCommit

當我運行上面的代碼,我得到錯誤代碼404,空bnoordhuis 未定義

任何幫助將是真棒!我是使用github api的noob。

這裏是我試圖用回購:https://github.com/joyent/node/

回答

1

你的倉庫應該僅僅是「節點」。 Joyent是用戶。

+0

我很傻,並認爲joyent是回購的一部分。謝謝! – Powerbomb