Join Ray Villalobos for an in-depth discussion in this video What we'll build, part of Building a Website with Node.js and Express.js (2016).
- [Voiceover] So, let's take a look at the finished version of our application. This is a fairly simple webpage that looks to be just a regular webpage. It does have some features that are very easy to do with Node.js and Express, that wouldn't be easy to do in other servers. So, for example, I have routing available to this application, which makes creating different pages with templates fairly easy. You can see that we have a speakers page right here and a route that takes you to a specific user and it shows you art work for that user as well as a photo with a bio.
All this is being fed by a JSON file. If we go to all the speakers, this is actually the exact same page as you just saw a second ago, but it's being fed different variables through routes to display different types of information. So as we go to say another one of these users, you'll see what looks to be another page, but in reality is the exact same html that is being displayed differently as we pass different data.
Another section of the site is this Feedback section. I've created an API here that allows you to enter feedback onto the site. So as we enter something into this Feedback forum and we hit submit, it's gonna appear right away on this page. No reload was necessary and, as a matter of fact, there is an API that is handling all this. So we're actually pushing information into a file that is managed with JSON.
So this page pushes information to that API and then we can add information by filling out this form or delete the information by clicking on these buttons right here. Express.js allows you to easily create an API and then use different HCTP verbs like get, host and delete to make changes to that API. We're also using the file system that is provided to us by no js, (mumbles) store that JSON file. Finally, we're creating a simple chat application, which is going to showcase some of the real time features that you can add with Node and Express.js.
Now if I go to a brand new browser and I type in a message as another user, you can see that both of the browsers are able to communicate with each other. To build this, we're going to use a piece of (mumbles) called Socket.io that makes real time communications fairly simple. So I hope you're excited about building this application. So let's get to it.
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