Just recently, I delved into using expressJS for the first time and found myself struggling to connect it to the github API. My aim is to execute commands that can help me retrieve comments and other information from a specific repository.
I would greatly appreciate any assistance with this!
Thank you in advance!
EDIT:
I attempted to use: https://github.com/mikedeboer/node-github but I'm unsure of how to incorporate this API with my expressJS application
Below is an example of what I have coded so far, but unfortunately, it's not functioning as expected:
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({
// optional:
// headers: {
// "cookie": "blahblah"
// },
user: "bnoordhuis",
repo: "/commit",
sha: "c30cc4e3a5ead3ca5b48e8eec445740775888ed8"
}, function(err, res) {
console.log(JSON.stringify(res));
});