What changes have taken place in the project’s response process since the front and back ends were separated and nodejs was used?

  node.js, question

Suddenly there was a problem: since most companies began to use the technology of separating front and rear ends.

  • Before the front and back ends are not separated, the page sends an XHR request to the server. After the data or logic processing is requested, the page returns to the browser end and the process ends. There are some browser-side pages that need to be rendered, which can be rendered directly by using velocity and placing a map object. Such as common modification operations, first need to obtain information, and then make changes. This is very convenient.

  • After the front and back ends are separated, the page sends an xhr request, which first reaches the front-end nodejs layer, then forwards it to the back end, and returns after the back end processes it. Is this really good?

What is the general company’s project structure after using front-end and back-end separation and adding nodejs? From one click of the browser user to the completion of the whole business process, what is the whole flow direction? ? ?

There is really no need to believe in the so-called complete separation of the front and rear ends. The difference between the front end and the back end is that the template page is rendered by which side and the data is inserted by which side. Besides, isn’t nodejs a server technology? It has nothing to do with the separation of the front and rear ends. Forwarding to the back end is when the browser executes js, and that can only be called v8 at most, not nodejs.
If the front and back ends are completely separated, I think React+Redux is relatively easy to implement, and the process is roughly as follows.

  • The user click a React Component.

  • Redux processes this action and requests data from the server

  • The server returns data and Redux changes the state of this React Component

  • React renders this React Component according to its state

  • Users See Responses