Check out a free preview of the full Full Stack for Front-End Engineers, v3 course

The "Servers" Lesson is part of the full, Full Stack for Front-End Engineers, v3 course featured in this preview video. Here's what you'd learn in this lesson:

Jem discusses a server as a computer that responds to a request and why servers are usually on dedicated hardware. The code to create a basic Node.js server is also provided in this segment.


Transcript from the "Servers" Lesson

>> So we've made it. We've navigated through the terminal. We learned how to edit a file in Vim. We learned how to edit our shell configuration and kind of what shells are. Now let's dive into I won't say the meat and potatoes because I feel like it's a little bit.

Let's dive into the core of really what we wanna do is we wana talk about service today. So let's understand what is the server, and I'm gonna talk about cloud computing. We're gonna talk about a VPS. Let's talk about operating systems which we just touched on a little bit.

And then we're gonna talk about SSH, one of the coolest, most important things you probably don't know enough about. And we're also gonna talk about hashing, because you can't talk about SSH without talking about hashing. Alright so, what is a server? You've all heard of it surely, it doesn't matter if your first time using computer you've been doing this for 50 years.

Everybody's heard of a server. So, what is a server?
>> A program that is listening for inputs that may or may not come over the network.
>> Yeah, I like that.
>> Or even a computer that hosts an application that listens for inputs.
>> Yeah, I like that too.

There's a
>> Yeah, in the chat.
>> A computer that serves content, it serves a request.
>> Yeah, everybody said the right answer. That's all it does it serves requests. That's it, there's nothing magical about that. It's more of a concept than anything. But really, anything can be a server, literally anything my phone, my computer.

If it's a computer, I can make it a server because I can just make the computer respond to some sort of formulated requests. However, when we think about servers, we think, dedicated hardware and there's a lot of reasons why to have a dedicated hardware. Servers run on different chipsets than the one we use on our computers, and that's for a variety of reasons like virtualization, which we'll talk about when we get to cloud computing.

Efficiency, they're generally more efficient than your home computers. But that's why server chip can cost 1000s of dollars versus that's how much my entire computer costs. Servers need to be available 100% of the time. So, yeah, in the next exercise, we're gonna write a home server here pretty simple.

We're gonna use Node and you'll say like, why can't we just do that? Why can't I build a web page based off of that? Well, what happens when you close your laptop and you go home for the day? Your webpage goes down, probably not a good idea. So, when we think servers we think dedicated hardware, it has to be available 100% of the time to other devices.

These are kind of the rules of what makes a server versus what's just my machine responding to requests. So for this one, this exercise, we're gonna make a really simple server receiving the call it simple server. We're gonna use Node.JS, and it's gonna be running on port 3000.

And if you're like, I don't know how to make a server, Jem, don't worry, we're gonna walk through this one together. I have all the code here. And this is all the code you need to create a server, probably even less because of the console log in there we don't need the port.

But so open vi create a file called simple server.js. And you can type all this out, and then I will type it out and then we're gonna learn how to run the server itself. We might need some homebrew, we might need some Node.JS, but it's all part of the fun

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now