I'm trying to host my Next.js application (only Frontend) on AWS Amplify. I can achieve this using the Static site generation of Next.js.
I somehow have to use a custom server (server.js) and it also means that my start script would be like: "start" : "node server.js"
instead of "start" : "next start"
.
I am facing a problem in serving my application amplify using this custom server. I found an article about Next JS SSR with AWS Amplify, but it includes some backend as well, which is not included in my case.
How can I use Next.js custom server with AWS Amplify? or there is no way to achieve this?
It turns out that AWS Amplify did not support the SSR of Next.js until recently AWS provided the support for SSR for Next as well as Nuxt. Here is the link to the documentation of SSR in AWS Amplify.