Serve nextjs app through go server

Hi, I have created backend in go that serves some api’s.
I created frontend in nextjs.
Is there any way to serve nextjs pages through go server ?
Like if url: “/” is called go app should server nextjs page or if “/users” is called go should server the json response.

If you use next export (assuming you are not using any server side logic), you can copy the contents of the out/ directory to wherever you want (you may need to use this: next.config.js: Base Path | Next.js) and serve those contents with static file serving with any golang server that supports static file serving.

Hi @kanishka , I am serving my go api with “api” as base url and after them i am using proxy to call the frontend url because I am serving build on another port.

It is working fine except not loading the all resources like css, images fonts

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.