After deploying my Next.js 13 app on Cloudflare Pages, I encountered an issue with the API routes. To address this, I had to export the runtime variable from each route in the following manner.
export const runtime = "edge"
During local development, I found that I need to switch this value to 'nodejs'. I attempted to use a Next.js environment variable for this purpose, but unfortunately, it did not work on Cloudflare.
Does anyone have any suggestions on a more efficient method to toggle between these two runtimes for production and development environments? Thank you in advance!