using github gist as a cms
1 min read • 16 Jun 2024Views:
Many times, we need a very basic cms for our hobby projects. For those cases, we can use github gist to have it.
Steps:
We need to create a public gist, with a json file having our config data
Once the gist is create, grab the gist id
Then, we can simply fetch its content by following url. The config data would be present at
response.files['your-file-name'].content
.
In our case it would beresponse.files[data.json].content
API: https://api.github.com/gists/<your-gist-id-here>
Example: https://api.github.com/gists/88c72cf2e8ba532a24024d9cfa5cc52a
- Once we get the stringified json, we can parse it and use it.
Video Tutorial