JSON 是 Web 中数据表示和传输最通用的格式,GitHub 是程序员所热爱的极乐开源社区,有时候我们在仓库存放一些 .json 文件,或者通过 GitHub Actions 自动构建输出一些 .json 文件,作为一个轻量数据源,那么我们如何去获取呢?
继续阅读
博客: reuixiy 原文链接: https://io-oi.me/tech/fetch-json-data-on-github-in-three-approaches/ 文章作者: reuixiy 发布日期: 2021 年 11 月 24 日
#reuixiy #github
还有一个文中没有提到的方法 - 使用 CDN 获取。 以 jsdelivr 为例,(免费)
https://cdn.jsdelivr.net/gh/${REPO}@${BRANCH}/${FILE_PATH}
GitHub 路径转 jsdelivr 路径工具: https://www.jsdelivr.com/github
#cdn #jsdelivr #github