Dear friends, use nodejs as the middle layer of the website, Python as the source layer of the background data.
1 Do you want nodejs and Python to be under the same domain name and listen to different ports? Or under different domain names ~
When the front-end part obtains the data, it usually submits the request to the nodejs layer, and then the nodejs forwards the request to Python, and returns to the original path after obtaining the data, or is it an excuse for the front-end to directly request Python? Great gods, thank you very much ~
The same domain name can be used.
The front and back ends are separated. In general, nodejs is used as a web server to render web pages. Python is the api server responsible for business logic and data access.
Nodejs mainly takes pure data from python interface and combines it with page template to optimize the first screen. cookie and session control can also be done here.
Python’s interface should return a pure data structure so that it can be shared with multiple terminals (Web iOS Android, etc.)