|
|
|
|
|
by yrezgui
3420 days ago
|
|
You have different options: The first one is to use NodeJS as your front end server and Golang for your API. The second one is to use NodeJS with React as an internal micro service to returns the HTML content back to the Golang front end server. The last one is to use a JavaScript interpreter within Golang. Some developers are doing the same in Java. Check this project for this option: https://github.com/robertkrimen/otto Now the question is which one is good. As always it depends on what you're looking for. I would say the NodeJS micro service renderer would be my favorite as it keeps all the complex logic in Golang. |
|
Golang + NodeJS microservice (option 2) is the same as the example I gave right? Where the client only communicates with a Golang server, which forwards the request to NodeJS/React for processing. The processed response is then returned by the Golang server.
Golang + JS interpreter (option 3), again the client exclusively communicates with a Golang server. But Golang types are translated to the equivalent React JS components. Then processed with NodeJS/React and returned as a response by the Golang server. Is that all right?