ailabtelkom / ailabtelkom.github.io

Artificial Intelligence Laboratory landing pages

Home Page:https://ailabtelkom.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move data member to static data

kelilipan opened this issue · comments

commented

I just noticed that we fetch member data from external API, but sometimes error occurred if we visit https://ailabtelkom.github.io/member from other pages
image

this is because if we visit from other pages it fetches data from API(client side), but your API is broken hence the error happens wkwk

My solution is to keep all data static no getInitialProps(deprecated) only getStaticProps. Put the data(sheet) somewhere permanent(e.g google sheet? or JSON) because Heroku is not free anymore then fetch data using getStaticProps, the cons is you need to rebuild every time data is updated tapi emang seberapa sering datanya berubah? nah let's keep it static since we use GitHub pages to serve this page, static is better.