Move data member to static data
kelilipan opened this issue · comments
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
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.