8 ms·
You can get a single file, but you cannot list them, afaik, maybe I'm wrong? Cloning is not that expensive, consider how many deps you fetch in a typical day.
by verdverm 4y ago
You can get a single file, but you cannot list them, afaik, maybe I'm wrong? Cloning is not that expensive, consider how many deps you fetch in a typical day.
I actually do this to fetch initial / bootstrap content stored in a repo, and hold it in memory without the need to write it. I am considering changing this and exec'n out to git as a more secure / standard practice
- 999900000999 4y agoI'm thinking you could probably configure GitHub pages to return JSON. And then you'd have a call which would basically return a listing of all the files, along with the URLs to get them.
- verdverm 4y agoAt that point, why not just put the listing as a file in the repo and just fetch that directly?
- 999900000999 4y agoI'd have to generate that file and commit it though.
- verdverm 4y agoah, you mean GHP producing something like a sitemap.json for your repo, hmmmmm
- 999900000999 4y agoExactly, I want to use the Git repo as a read only REST API.
- verdverm 4y agoYou could always use something like S3 or GCS if GHP doesn't work