To enable scheduled tasks in our NestJS application deployed on Vercel, we need to utilize Vercel Cron Jobs. Since Vercel does not support native server-side cron functionality, we will implement endpoints in our application that can be triggered by Vercel's Cron Jobs feature. Additionally, the vercel.json file should be updated to define the cron job schedules and link them to the appropriate endpoints.
To Do
[ ] Create a New Module:
Introduce a new module in the NestJS app, e.g., web-scheduler.
Implement controllers within this module that expose endpoints corresponding to the scheduled tasks.
[ ] Update vercel.json:
Add configuration for Vercel Cron Jobs in vercel.json.
Define the cron expressions and associate them with the newly created endpoints in the application.
Deliverables
[ ] A new web-scheduler is created in the application.
[ ] The module contains controllers with endpoints for handling scheduled tasks.
[ ] The vercel.json file includes the required cron job configuration, mapping to the new endpoints.
[ ] Scheduled tasks are triggered successfully using Vercel Cron Jobs.
Description
To enable scheduled tasks in our NestJS application deployed on Vercel, we need to utilize Vercel Cron Jobs. Since Vercel does not support native server-side cron functionality, we will implement endpoints in our application that can be triggered by Vercel's Cron Jobs feature. Additionally, the
vercel.json
file should be updated to define the cron job schedules and link them to the appropriate endpoints.To Do
[ ] Create a New Module:
web-scheduler
.[ ] Update
vercel.json
:vercel.json
.Deliverables
web-scheduler
is created in the application.vercel.json
file includes the required cron job configuration, mapping to the new endpoints.