Getting Data From Backend Server
Learn how a frontend file can interact with the backend server to save and retrieve data.
In this lesson, we will discuss how the front-end can interact with the backend server to exchange information. The front-end does not have to be in Vue.js in general because any language or front-end technology can follow the protocol defined by the backend server. That is why the same backend server can be used for multiple front-end technologies. Moreover, native or hybrid applications can also use the same backend server because of the same reason.
Although this course is on Vue.js, this particular lesson will demonstrate how a vanilla JavaScript program can connect to the backend server to exchange information without using any front-end framework. The same protocol is used by all front-end clients so this lesson will demonstrate the front to backend communication without discussing the details of the front-end technologies involved.
Front-end and backend connection port
The front-end needs to contact the backend server that is listening on a specific port
so the backend can respond to those requests. The port is specified by the backend server and the front-end needs to know it. The ...