var GitHubApi = require("github");
```javascriptvar github =新的GitHubApi({
调试:真
});
github.authenticate({
类型:"oauth",
令牌:
});
github.repos.getContent({
用户:“用户名”,
回购:“回购-用-构建-迪尔”,
路径:“/build”,
裁判:“一些裁判”,
},函数(err,res) {
console.log(err, res.content);});
我得到的结果如下所示:[ { name: '.htaccess', path: 'build/.htaccess', sha: 'someSha', size: 1787, url:'https://api.github.com/repos/sapo/fd1/contents/build/.htaccess?ref=refs/heads/development', html_url:'https://github.com/sapo/fd1/blob/refs/heads/development/build/.htaccess', git_url: 'https://api.github.com/repos/sapo/fd1/git/blobs/someSha', download_url:'https://raw.githubusercontent.com/sameRepo/fd1/refs/heads/development/build/.htaccess?token=someToken', type: 'file' } ]
问题/问题
每当我试图直接访问浏览器中的任何urls- html_url、git_url、download_url --我都会得到一个404 not found错误。
我所要达到的目标是:
我需要能够传递到S3.upload方法的链接。因此,基本上,将这些文件复制到S3桶。
问题
你能告诉我为什么我会得到404错误吗?另外,对于如何使用urls下载文件的内容,有什么想法吗?感谢任何我能得到的指点。
谢谢。
发布于 2017-07-30 07:00:35
每当我试图直接访问浏览器中的任何urls- html_url、git_url、download_url --我都会得到一个404未找到的错误。
因为我不能访问https://github.com/sapo/fd1,所以我认为它是一个私有存储库。
要排除故障,请确保您是正确认证、OAuth访问令牌具有所需的作用域和第三方应用程序限制没有阻止访问。。
https://stackoverflow.com/questions/45396921
复制相似问题