When #NuxtHub adds CRON support for Nitro tasks (likely soon), updating should be as easy as:
- Remove the api route.
- Add a schedule to the task directly.
Your tasks will be ready to go without rewriting the logic!
When #NuxtHub adds CRON support for Nitro tasks (likely soon), updating should be as easy as:
- Remove the api route.
- Add a schedule to the task directly.
Your tasks will be ready to go without rewriting the logic!
This approach doesn’t leverage the extended limits of Cloudflare Workers when triggered natively via CRON.
But it’s a solid, temporary workaround to automate while waiting for full CRON support. 🚀
This approach doesn’t leverage the extended limits of Cloudflare Workers when triggered natively via CRON.
But it’s a solid, temporary workaround to automate while waiting for full CRON support. 🚀
You can now create a CRON task in your external service, pointing to your api route with the appropriate Authorization header :
You can now create a CRON task in your external service, pointing to your api route with the appropriate Authorization header :
Set up an api route that validates the token and triggers the task:
Set up an api route that validates the token and triggers the task:
Add a token as an environment variable (e.g. NUXT_CRON_TOKEN) and in your Runtime Config.
Then create a small utility function to ensure only authorized requests can trigger tasks:
Add a token as an environment variable (e.g. NUXT_CRON_TOKEN) and in your Runtime Config.
Then create a small utility function to ensure only authorized requests can trigger tasks:
For example, a task that sends weekly emails:
For example, a task that sends weekly emails:
chromewebstore.google.com/detail/stimu...
chromewebstore.google.com/detail/stimu...