简体   繁体   中英

Should I have a NodeJS server for react server-side rendering?

I have a API server which is written in python. And I wanted to render my react components on server side. So I searched the best practices and result was having a nodeJS server.

But in my thoughts, this is weird because I have to build a another server with different language. This is bad at maintainable, and maybe have an overload.

So I want to know having nodeJS server is usual. and also how do big companies do server-side rendering.

If it is as simple as wanting to use Python with React, you can use python-react to render React components.

As noted above, if you are using Flask, the templating is in Jinja2, but that isn't necessarily mutually exclusive to using React in your project.

This resource on using Flask/React may be of use to you, as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM