One of the best features of express is how easy it is to work with routing. Routing allows you to give users access to different types of data as well as pass information through the params variable of the request object.
- [Voiceover] One of the core features…of Express is called routing.…Routing allows you to get information…for different parts of your website to users.…Now we've already seen how we can use app.get…to create a route for home,…so let's take a look at how you create other routes.…Now routes for other URLs are created in the same way…as our homepage, with the app.get statement.…The interesting thing is that you can pass variables…to app.get and receive them into the route…with a special variable available…through your request called params.…
So if we go into our application, I'm gonna clean this up…because I still have a lot of my old node js code down here,…and what I want to do is create a different route,…and I've got a really nice route that is showing me…all the speakers, so I'm gonna make a copy…of this route right here, and just paste it down here,…and I'm going to change the name…of it down here to Speakers.…And that's how you create a different route, you put in…a different piece of text right here,…and it allows you to go to another URL of slash speakers.…
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