Day 87 Node.js Creating A Server

Today I practiced making a simple web server. However, we started with a few conceptual asides of what the internet is like what is a protocol, TCP/IP, port, and HTTP.

A protocol is a set of rules two sides agree on to use when communicating. Both the client and server are programmed to understand use that particular set of rules. It’s similar to two people from different countries agreeing on a language to speak in.

Two essential protocols that allows the internet to work is TCP and IP. IP stands for internet protocol address which agrees that each device connected to a computer network has their own numerical label. TCP stands for Transmission Control Protocol. It allows any information we are sending and splits it into pieces and sends it one at a time through a socket, from computer to computer. That individual piece is called a packet. The act of sending it in small packets of data is TCP.

Once a computer receives a packet, how it knows what program to send it to is a port. When a program is setup on the operating system to receive packets from a particular port, is considered “listening” to that port.

HTTP is a set of rules (and a format) for data being transferred on the web. Stands for HyperText Transfer Protocol. It is the core of how we send information on the internet from HTML, JS, and image files. It’s a format to define data being transferred via TCP/IP. Along with HTTP another important aside is MIME type. It’s a standard for specifying the type of data being sent. Stands for multipurpose internet mail extensions.

Here is the simple example of creating a web server in the course.

Then we later changed the MIME type to read HTML and JSON files.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up ↑

%d bloggers like this: