Github gist + Github pages

twitter logo github logo ・1 min read

I host my personal website on Github pages, Every time whenever I wanted to update website I had to update code, because data was part of repo.

Recently I learned that we can access gist by api, So now I am hosting my data on gists and loading it dynamically with API call. Which is pretty cool.

Without Database and backend now I can update website anytime without actually updating code.

Here is sample code

let url ="https://api.github.com/gists/9052ef9a070e0d5ab046fa3464d026c4";
fetch(url).then(response => {
   response.json().then(data => {
     let profileData =JSON.parse(data.files["personalData.json"].content)
   })
 })
twitter logo DISCUSS
Classic DEV Post from Sep 1

Working as a freelancer

What is/was your experience working as a freelancer?

Abhishek Singh profile image