Table of contents
Do you find Node JS difficult? No worries Nodeman is here to help you out. In this blog, Nodeman will explain to you what Node JS is? Also in the upcoming blogs, he will explain to you how can you create your own server using node js. You can call the compilation of this and the upcoming blogs as fun documentation to learn Node JS.
console.log( ARE YOU READY? );
As this is the first blog of this series, let's go to the very basics of how does the web work?
Didn't understand the image no worries. I haven't explained anything yet. Suppose your friend living in a foreign country sent you a parcel and that parcel is now available at the import-exports office of your country, you were told to go to their office and give them the name of the parcel that you want to collect and collect the parcel. But now you are also a very busy person who is very busy in reading this blog, you told your home servant to go the exchange's office and collect that parcel on the behalf of you. Your servant went, collected that parcel, and served that parcel in front of you.
The same thing is happening between your browser and the server. Suppose that friend who sent you the parcel as a web developer in the real world and that gift as the web pages. You want to access that gift but you can do that as there are some policies of your country, you cannot access that directly, there are some rules (you have to go the exchange's office and give them the name of the parcel, then only they will give you the parcel ). That set of rules is called protocols in the web dev world.
You were going to the exchange's office. Now, in this scenario, you have to go to the server but you are lazy or you are busy you do not have the time to go, you called your servant to go there on your behalf. Here comes the role of your browser. Your browser says "do not worry master, I will go to the server and give them the name of the parcel (URL Link of the site) and collect the parcel from (files that are used to create that site: HTML, CSS, JS files ) and present in front of you".
Your browser went to the server, collected files, and presented them in front of you in a very nice format (nice format means codes in between the h1 tag will be presented in big and bold letters and rest you understood).
This was the whole story behind how does the web work.
If you are reading this I am assuming you have must be done some work in HTML, CSS, and JS. HTML, CS, and JS are used to create web pages i.e the present that you will send to your friend. Now in Node JS, we will be creating the web servers that are the exchange offices. It might sound too heavy to create servers but trust me it's not. Even it is much easier than creating web pages.
For today, I think it's enough, I will come tomorrow with a new story and hopefully, we will be writing our first code in NodeJS.