Nextjs api endpoint in production


I have an api folder in my next.js app for some server side endpoints:

In development it works perfectly:

But in production I got 500 error. (deployed to vercel)

What other configuration should I add to my next.config file to make it work, I am beginner with this api.

Hi @radikris, we see that the API call to is returning a 500 error, which is returned when something has gone wrong on the web site’s server. These API routes are setup within your app outside of Builder, and so we don’t really have any insights into these specific issues. I would recommend checking out NextJS’s documentation for API routes here: API Routes: Introduction | Next.js or contacting their support for more help!