Next.js Discord

Discord Forum

I want to use node-cron with NextJS

Answered
North Pacific hake posted this in #help-forum
Open in Discord
Avatar
North Pacific hakeOP
Hi there,

I am trying to set up a cron job which will automatically do something every 1 hour in NextJS serverside. Where would I set up the functionality for this? https://www.npmjs.com/package/node-cron

Thank in advance!
Answered by () => "anay-208"
if you want, you'll have to use custom server
View full answer

4 Replies

Avatar
North Pacific hakeOP
Note: I am aware of vercels cron, I am not deploying on vercel.
Avatar
() => "anay-208"
you can't, because nextjs is completely serverless
Avatar
() => "anay-208"
@North Pacific hake
Avatar
() => "anay-208"
if you want, you'll have to use custom server
Answer