Edge runtime for /api route
Unanswered
Akbash posted this in #help-forum
AkbashOP
I’m kind of stumped on this, new to Nextjs.
I’m doing a simple email subscribe form that POSTs some data to my database via API. Running in local host works, but when I deploy to cloudflare it fails because I’m not including the edge runtime import. But when I add the edge runtime import my localhost breaks.
I’m doing a simple email subscribe form that POSTs some data to my database via API. Running in local host works, but when I deploy to cloudflare it fails because I’m not including the edge runtime import. But when I add the edge runtime import my localhost breaks.
10 Replies
@Akbash I’m kind of stumped on this, new to Nextjs.
I’m doing a simple email subscribe form that POSTs some data to my database via API. Running in local host works, but when I deploy to cloudflare it fails because I’m not including the edge runtime import. But when I add the edge runtime import my localhost breaks.
are you deploying your next app to cloudflare?
AkbashOP
Yeah
@Akbash Yeah
any reason u do this?
AkbashOP
I use it as my host
u can deploy it to vercel and connect your domain from cloudflare
otherwise follow this https://developers.cloudflare.com/pages/framework-guides/nextjs/ssr/get-started/
cloudflare can be a little bit tricky
i dont even know if this is up to date
otherwise deploy via vercel https://vercel.com/new
AkbashOP
thank you!