Open valid-void opened 2 years ago
follow this tutorial for more details: https://www.youtube.com/watch?v=w3vs4a03y3I
weatherAPI
server
npm init -y
npm i express
npm i nodemon -D
(to auto-restart server if needed)server
npm start dev
follow this tutorila for more details: https://www.youtube.com/watch?v=StkFajPnd7w
npm install node-schedule
next: add this number to a database e.g. node-sqlite3 npm install sqlite3
next: call this data array form frontend
next: updated frontend if backend data has been updated
it is not possilbe to schedule server side task on sanity (https://stackoverflow.com/questions/64310565/is-it-possible-with-sanity-scheduled-external-api-calls-to-sanity)
It can be done with Netlify:
https://docs.netlify.com/functions/scheduled-functions/
npm install @netlify/functions
roadmap
server-side api call
call backend through Express api