Building Web Applications with Node.js and Express 4.0 (UPDATE)

With Node.js, you can take your existing JavaScript knowledge and use that to build full-stack web applications. This course will teach you how to build out routing, databases, and third-party APIs in Node.js and Express.
Course info
Rating
(98)
Level
Intermediate
Updated
Mar 23, 2018
Duration
5h 12m
Table of contents
Description
Course info
Rating
(98)
Level
Intermediate
Updated
Mar 23, 2018
Duration
5h 12m
Description

Node.js is a simple and powerful tool for backend JavaScript development. In this course, Building Web Applications with Node.js and Express 4.0 (UPDATE), you will learn everything you need to know to get started in web development with Node.js. First, you will cover the basics of Node.js and how to select an IDE. Second, you will explore template engines and how to render in HTML out of Express. Next, you will learn all aspects of routing, including express middleware. Finally, you will work with multiple databases and backend APIs and will cover local security with Passport.js. By the end of this course, you will have all of the tools you need to build a full-stack web application with Node.js and Express.

About the author
About the author

Jonathan Mills is a JavaScript and Node.js expert working mostly in the MEAN Stack with individuals and companies to help build their technical skills to cope with the constantly changing landscape of software development. He is also an ASP.NET insider and an international speaker focusing on JavaScript both in the browser and on the server.

More from the author
Testing JavaScript for Node.js with Mocha
Intermediate
2h 28m
4 May 2017
Advanced AngularJS Workflows
Advanced
1h 31m
9 Nov 2016
More courses by Jonathan Mills
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name's Jonathan Mills and welcome to my course Building Web Applications with Node. js and Express. Now I've been a JavaScript developer for quite a long time and I love being able to leverage those JavaScript skills in building backend web applications. I can take JavaScript anywhere I need it to go. So in this course, we're going to build a web application from the ground up using Node. js and Express. Some of the major topics we're going to cover, we'll cover quite a bit. Templating engines, there's a couple of different ways to write html out. And we're going to talk about what those are. We're going to talk about databases. We're going to cover both Mongo and SqlServer so you'll get a look at both different kinds of databases. We'll do some security with passport so you can see how to create users and how to log in and log out. And we're going to do some 3rd party APIs so that you can understand how to call out to a different API and pull data in and use that in your application. Now by the end of this course, you should be able to build a full blown web application all on your own. I'm going to cover just about everything you need to know to make that happen. Now before the beginning of the course, you should be familiar basically with JavaScript. I'm not going to talk about what JavaScript is and how JavaScript works but I will cover Node from the ground up. So you don't need to have any Node experience but it's helpful if you know JavaScript. So hopefully you'll join me on this journey to learn all about Node. js and Express here at Pluralsight.

First Page
Alright, in this module we're going to set up our first page. While that may seem like a simple thing, index. html, there's actually quite a bit to it and this module sets the groundwork for building out the entire application that we're putting together. What you're going to learn in this module, is how to do index. html. Seems pretty simplistic but there's quite a few steps involved in this. First thing we got to do is get Express setup. Let's actually be serving a route in Express, just our slash route, just the beginning one, but let's get a route set up. Once we get that part, let's run Express, let's get express going and working the way we want it to. We're going to take a detour in the middle of this module, we'll talk about some logging options, we'll talk about debugging and we'll talk about chalk and Morgan and some other pieces that we'll use to help our logging experience look a little bit better. Then we'll serve up HTML, we're not going to get into the templating engines yet, we're just going to serve up straight HTML and work to get that. But as part of serving up HTML, if we want our HTML to look good, we also have to serve up some static files. So, our CSS and our JavaScript and things like that. We'll pull in bootstrap, we're not going to build our own CSS yet, we'll do that a little bit later on but for right now, just to show serving static files, we'll pull in bootstrap and because it's required, we'll pull in jQuery and I'll show you a couple of different ways to pull those pieces in and give you some options there to what would work best for you in your environment.

Routing
So we're working our way through building out a web application and in this module we're going to start talking about routing and we're going to build out some routes for our application. Now we've come pretty far in our journey to build out a web application. We've got some tooling set up, we've got basics of a webpage showing, we imported a template that gave us a nice looking webpage to get started with and in this module we're going to start building out routes, we're going to have a book route, we'll have a single book route. We'll kind of work through all that. Now we're going to be generating some code as we do that and so we're going to start talking about how to separate out our files. Right now everything's in one file, in app. js, and we're going to talk about how to pull that apart so we have multiple files. We're going to add some parameter variables to our search, like when we build out a single book, I want to pass a book ID, so how do we do that in our routes? And we're also going to talk about router functions. We're going to create our router but we're going to do it as a function so we can pass things in on the creation so we can create different things, or pass config variables in and things like that. So let's get started in building out our routes.

Authentication
In this module we're going to talk authentication and creating users for our web application. Now, we've come quite a long way in this course on building a web app with Node. js and Express. And we've got databases set up, we've got routing done, we're pulling stuff out of the database, displaying it to the screen, all that's there, but there's an important thing that we're missing that most applications that you might be working on require, and that's the concept of a user. So in this module, we're going to start creating users. We're going to create new login, the password, you can sign up and sign in, and all those types of things. We're going to do authentication. You'll enter a username and password and we'll validate that that's correct, and we'll log you in appropriately. We'll do authorization. And so, authorization is the ability to block certain pages. We're actually going to block most of the website if you're not signed in. So, you can't get to the profile page. You can't get to the books. We'll block everything if you're not signed in. And we're going to do all this using this thing called Passport. And Passport is the default npm package that Express uses for user management. We're going to mostly use the local strategy in this course, but there's other strategies for handling Google, and Facebook, and LinkedIn, Integration, and all those other things. So, let's get some stuff done.

Structure and Third-party APIs
All right, we're going to round out this course with this last module, and we're talking about a couple different things. We're going to talk about the structure of our code, and we're doing that on purpose, because we're going to build on some services for some third party API calls. Alright so, we are almost done with this course of building a web application and if you've made it this far, which you have, because you're listening to this then great job, you've learned a lot and we're going to round this out by talking about some code structure. Right now, everything's in one file. Like all of our routes have all of our code in them, and that's not very testable. It's not very easy to deal with, and so we're going to talk about how to pull those things apart, and implement some controllers, and our controller is what's going to have all of our router code built into that. We're also going to build some services, or specifically, a third party API service. So, we're going to hook up to Goodreads, which is a website that deals with books, and we're going to pull information from a Goodreads API to populate our web page.