It's time for us to create our own server using Node.js.
But before we get into that, let's understand to the question what is a server?
Technically, a server is a computer program that runs on a computer.
Well, this definition doesn't seem to be clear.
So let's break it down into layman's understanding of a server.
A server is a program that accepts requests from clients and then responds to those requests.
The key word here is called the request and response.
These two are the core responsibility of a server.
A server, always take a request from a client and then process that request and give a response to
the user based on the request.
So as a back end developer, the server that we are going to create or you are going to create the core
responsibility is to handle requests and response.
Let's go back when we treated components of a Web application and let's talk more about a server.
Well, a complete application comprises of clients.
That is the front end part.
So when we say clients, you always refers to the browser.
For front end application, we use HTML, CSS and JavaScript to develop the front end application or
we can use React.
And that is what we have covered.
That is HTML, CSS and JavaScript, and this is the front part of the application.
Now to make a web application complete, definitely we need what is called a server.
And the server that we are going to create, we are going to use Node.js to create our own server.
So when a user makes a request, definitely the user is trying to fetch a data.
In that case, we also need a data source.
And we are going to use what is called MongoDB.
Now let's look at the flow.
Let's say that this client over here want to make a request to YouTube to fetch or to view trending
videos.
So the user will enter the URL of our server.
In this case, going to be a looker.
Host In production we're going to get our custom u URL.
So let's say that we have developed this server called YouTube server.
So when a user enter the URL and search for particular video, it means that this particular user is
talking to our server.
Then the server will also make a request to the database.
So at this point, this what we call requests, meaning requesting what you want.
Then after some time the server will be processing the data.
At this point you're going to see loading.
So after the request has completed and the response is ready, then the MongoDB or database source will
send back the actual response to the server and the server will also send the results to the user.
And this is what we call response.
So as a backend developer, before they request get to the server, we are going to implement the code
to handle that request.
And then after the request has been received at this point to we are going to code to make business
logic to fetch a particular video.
So now we are done with the front end.
So we are going to focus on the back end.
That is our server.
And the server comprises of the actual server and data source in this case MongoDB database.
So this is what we are going to talk about to make a complete server.
But let's move step by step and let's focus on a server.
So in the upcoming videos, we are going to use no charges to create our own server whereby a client
can visit our URL and then we will send a user what the person is requesting for.
Let's get into that in the next video.