new-worker-scheduled.js 700 B

1234567891011121314151617
  1. /**
  2. * Welcome to Cloudflare Workers! This is your first scheduled worker.
  3. *
  4. * - Run `wrangler dev --local` in your terminal to start a development server
  5. * - Run `curl "http://localhost:8787/cdn-cgi/mf/scheduled"` to trigger the scheduled event
  6. * - Go back to the console to see what your worker has logged
  7. * - Update the Cron trigger in wrangler.toml (see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers)
  8. * - Run `wrangler publish --name my-worker` to publish your worker
  9. *
  10. * Learn more at https://developers.cloudflare.com/workers/runtime-apis/scheduled-event/
  11. */
  12. export default {
  13. async scheduled(controller, env, ctx) {
  14. console.log(`Hello World!`);
  15. },
  16. };