Next.js Discord

Discord Forum

Is creating an Next project (deployed to vercel) to only serve as API is a bad pratice?

Unanswered
Crème D’Argent posted this in #help-forum
Open in Discord
Crème D’ArgentOP
I will only use the API routes, and will use prisma to read the database

10 Replies

@Crème D’Argent I will only use the API routes, and will use prisma to read the database
Well you pretty much get the same behaviour with just vercel serverless functions, so installing next will just make your node_modules unnecessarily heavy
Other than that, no particular drawbacks that I can think of
@Crème D’Argent What do you think about using HONO + next?
American Crow
And deploy it to Cloudflare Workers?
Well thats basically what Vercel does internally for it's edge functions :q
Crème D’ArgentOP
I was thinking about dwploying to vercel, following this guide
https://hono.dev/getting-started/vercel
American Crow
You want a API only Application which you create with Web Standards (Hono). To then deploy it on Vercel which itself will deploy it to Cloudflare Workers?
:galactic_brain:
create a nextjs project purely for an api is totally fine and deploying it to vercel is too
you dont even need to use hono or express or anything like that
@linesofcode create a nextjs project purely for an api is totally fine and deploying it to vercel is too
Crème D’ArgentOP
yeah you are right, I was overthinking, I will just sticky with app routes