wrangler.tomlに追加する
[triggers]
crons = ["*/10 * * * *"]
index.jsに追加する
addEventListener('scheduled', event => {
event.waitUntil(triggerEvent(event));
});
async function triggerEvent(event) {
// Write code for updating your API
switch (event.cron) {
case '*/10 * * * *':
await updateAPI();
break;
}
console.log('cron processed');
}
async function updateAPI() {
console.log('cron')
}