Next.js Discord

Discord Forum

Lifecycle of api routes / server actions

Unanswered
AM posted this in #help-forum
Open in Discord
AMOP
Hello, I know we can have cron jobs or request/response for API routes. However, is it possible to have an API route that gets called when the app is deployed on Vercel, subscribes to the blockchain, and listens for events, similar to a lifecycle event?

Similar to onModuleInit() from NestJS: https://docs.nestjs.com/fundamentals/lifecycle-events

0 Replies