export default {
fetch: app.fetch,
scheduled: async (event, env, ctx) => {
ctx.waitUntil(cronTrigger(event, env));
},
queue: async (batch: MessageBatch<Error>, env: Environment) => {
fetch("https://api.pushover.net/1/messages.json", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams({
token: "xxx",
user: "xxx",
title: "Hono",
message: "Example of cron and queue",
}),
});
},
};
export default {
fetch: app.fetch,
scheduled: async (event, env, ctx) => {
ctx.waitUntil(cronTrigger(event, env));
},
queue: async (batch: MessageBatch<Error>, env: Environment) => {
fetch("https://api.pushover.net/1/messages.json", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams({
token: "xxx",
user: "xxx",
title: "Hono",
message: "Example of cron and queue",
}),
});
},
};