Hello 👋
Please bear with me because I don't really know what I'm talking about here...
For my side projects I have always used Vercel, which obviously works flawlessly out of the box, and I've never thought to even consider how I would go about hosting a next app outside of Vercel.
However, I recently created an internal app for the company I work for as part of a hack project with another dev - There was some existing infrastructure in place, and my job was to replace the existing CRA with a better app, for which I used Nextjs (I will say the current scope of the project probably didn't need to use Next, but it'll be useful as and when the project grows)
This is where I'm out of my depth - The previous CRA was hosted using Spring and WebFlux, used to serve static html pages... Obviously, when it came time to host the app, it was abundantly clear that NONE of the Server Side stuff worked at all - Dynamic Routing, Server Actions, SSR etc...
To fix this in the interim, I've had to move all requests to the client and remove the dynamic routing so my app would build as a static site. Fortunately, using this Spring/WebFlux setup, I was able to match the URL and serve the previously dynamic route as a static page, using the route to build the URL my client-side request.
As a solution - This works fine, but obviously not as I ever intended.
My backend knowledge is incredibly minimal, and I don't know where to even start to actually fix this - Hoping someone here can point me in the right direction - I will share some of the existing code below that I had to tweak to make it work.
Thanks a lot! 🙏