All of the files for this course are freely available in Github for all users at this URL. In Github, you'll see that the project is organized in branches. Each branch corresponds to a video in the course. You can clone this repo into your local hard drive if you want to follow along. The best way is to clone all the branches. In order to do that, you need nodejs, which you can get from this site as well as git, which you can get here. When you install Git, make sure you add the gitbash terminal in windows, it makes running the commands more consistent.
- View Offline
- [Voiceover] All the files for this course are freely available in Github for all users at this URL. In Github, you'll see that the project is organized into different branches. Each branch corresponds to a video in the course. They're named according to the video that they correspond to. If you see a B at the beginning of a movie, that would be the files for the project at the beginning of that video. So 01_03B means chapter one, movie three at the beginning and if you see an E at the end of the name of the branch, it means that those are the files at the end of that video.
You can clone this repo into your local hardrive if you want to follow along. The best way to do that is to clone all the branches. Of course you're gonna need Node.js which you can download from this site. You'll also need Git in order to work with Git in Github. So you can get Git on this website. If you're on a PC when you install Git, make sure you add the Gitbash terminal in Windows it makes running the commands a lot more consistent. So let me show you how to clone all the branches for the project into your local directory.
First I'm gonna go back into Github and I'm gonna use this link right here to copy the clone URL. Once I do that, I'm gonna switch over to my terminal application and first I'm gonna make sure that I'm on the desktop so I'll do a cd and then the tilda slash desktop and once I do that I'm going to make a new folder with mkdir and then the name of the folder I'll use expressjs as my folder name.
You'll see that folder appear on your desktop. Now I'm going to switch to that folder by using a cd command. And then I'm going to issue a git clone command to bring all the files from Github into that folder. So I'll do a git clone and I'm gonna use a minus minus bare option, that's gonna bring all the different branches at once, then I can paste the URL from Github. And I need to add an extra .git at the end.
I'm gonna hit return. This will clone the repository. After that I need to change the configuration of my project so I'm going to issue a git config minus minus bool space core.bare false. That's gonna make this into a regular Github project and now all I need to do is do a git reset minus minus hard command. And that's gonna reset the head pointer in git so that the project is at it's last state.
Now that also means that I have all the branches. Let me clear the screen, if I do a git branch command you'll see all the branches for the project. The master branch is how the project looked at the end of the course. If we take a look at the expressjs folder, you should see all the files in here. So there's an app folder and there are some other sub folders in there. Now whenever you install a git project, you're not going to receive a special folder called Node Modules with additional plugins for the project.
So you'll always have to issue an npm install command and that's gonna download all the plugins for you. I'm gonna go ahead and clear this. And now I can issue an npm start command. And that will start my server at port 3,000. So now I can go to a browser. And now I can go to local host 3000 to see my project.
If you want to go to a different branch, I'm going to hit control C and then I'll go ahead and clear this out. And then I can issue a checkout command for a different branch of the project. Let's say for example that I want to look at chapter three movie one and get the beginning version of how the code looked at the beginning of that video. I can issue a git checkout command and then specify 03_01b. That switches me to that branch. Now if I've pulled my express.js folder into my editor.
You'll see all the files as they looked in that video. If you want to learn more about how to work with git and Github, you should check out one of my other courses up and running with git and Github. So that's everything you need to know, so let's get started building a website with Node and expressjs.
In this course, Ray Villalobos walks through the process of creating full-featured websites with these technologies. First, find out how to install each package and leverage Node.js features from within Express. Then learn how to build a basic application with templating engines like EJS; create more flexible, modular code with includes and conditional statements; build APIs to manage HTTP requests to add and delete content dynamically; and configure more complex routing. Along the way, Ray implements features like customer feedback forms and real-time live chat, so you can see exactly what Node.js and Express are capable of.
- Handling HTTP requests with Node.js and Express
- Creating and modularizing routes
- Using templates
- Building flexible views
- Creating an API route
- Dealing with POST and DELETE requests
- Creating live chat features with Socket.IO