Next.js Discord

Discord Forum

Edge runtime for /api route

Unanswered
Akbash posted this in #help-forum
Open in Discord
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.

10 Replies

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
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!