Starting from this lesson, we are going to start exploring how JavaScript works in the backend. Before we start, you must familiarize yourself with some basic concepts.
Server and client
First of all, you need to know what is a server and what is a client.
Both the server and the client are computers. When you open a browser and visit a website, your computer will be the client.
The client will send a request to the server requesting certain data and resources. If the server is OK with that request, it will send an OK response back to the client and then start transmitting the requested resources.
If the server is not OK with that request or encounters a problem, an error response will be returned. There are several different types of error responses, each indicating a different type of error. We will delve further into them later.
Sometimes, the client will submit new data to the server, such as when you submit a new form. The server will take that data, perform some tasks, and maybe return new data back to the client.
The interconnected network of servers and clients forms what we call the Internet today.
Different network protocols
When requests and responses flow between clients and servers, they have to follow a specific format so both ends know how to process them. These formats are called network protocols.