Next.js Discord

Discord Forum

How does deploying a fullstack app of next (including route handlers) on aws amplify work?

Unanswered
futuredevengineer posted this in #help-forum
Open in Discord
Avatar
as title said, i want to know

9 Replies

Avatar
Sloth bear
Probably is a docker container.
You won't have the serverless and all things Vercel is doing.
Avatar
I kind of managed to successfuly deploy on amplify, apparently, instead of separating server components logic from route handlers logic, i would just do the business logic (database calls) on server components, and forget about the route handlers.
this way, you won't have to make any fetch call from server component.
Avatar
you can use SST for it: https://sst.dev/docs/start/aws/nextjs/
It includes either deploying via OpenNext or via docker
Avatar
btw, is it possible to setup nextauth on server component, so instead of having api route api/auth/[...nextauth] i would do the same setup but in server component?
Avatar
why do you want to handle something with a server component when you should handle that with a route handler? Using SST will handle that automatically for you
Avatar
yeah well, whatever happening inside the route is basically a db call, that why
Avatar
nah, it's not as you can see here: https://nextjs-forum.com/post/1317028837887840306#message-1317045971670274049 <--- click
Try SST and you'll see that everything will work fine