Preventing route handler firing during build
Unanswered
Masai Lion posted this in #help-forum
Masai LionOP
I have a route handler in my nextjs project that is responsible for creating a new item in my database. My goal is to attempt to use vercel cron jobs or some other service to create a new item everyday. What I've noticed is that when I'm building my app, the route gets precompiled and it fires a request to the database, which causes an error because there is a constraint. Is there a way to prevent this action from happening during the build step of my site or some way to specify that this page can only be accessed in certain ways?