Rendering frontend with GO

Hello All,

I am looking forward to build a gateway in GO that will perform two main tasks at broader level.

  1. Act as API server that will hide the microservices running in the backend.
  2. Render Frontend that is written in React.

Frontend will be a kind of Single Page App, which will have its webpages fillled dynamically with data retrieved from REST responses returned by the APIs exposed by gateway.

My question is it possible to render frontend written in React through GO server? Basically this server will be responding to REST requests as well render html pages created through React. If it possible, is there any project that can be referred to get the idea that how to render frontend written in React through GO server?



a React app (the same is for Angular, Vue, …) at the very end is compiled as static app (HTML, CSS, JS files) that needs to be served by an HTTP server.
Here you can find an example using the go-chi router to serve static files; but in general you can serve everything you want.
Searching in Google you’ll find tons of examples.


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