From the course: Building a Website with Node.js and Express.js
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Using parameter routes
From the course: Building a Website with Node.js and Express.js
Using parameter routes
- [Instructor] With the speakers list in place, all that is missing now is the detail page. Let's again click on one such link in the speakers list. And you see that we end up on a page that contains the shortening of a given speaker. And we want to now create the route that shows the detail page for a speaker by a given short name. For that, I open Visual Studio Code again. And I first want to implement this route. So I go into speakers. And we now need some way to get the speakers details by the short name. And you see that we have a parameter route here already that gets the short name. And now I'll start out by adding const speaker equals await. And of course, I have to add async to the callback here. And I'm using the speakerService here. And that now, I need a method that gives me a speaker by their short name. So let's look into SpeakerService. And there, on line 68, you should see this method. So, it's…
Contents
-
-
-
-
-
-
(Locked)
Create a site-wide layout6m 54s
-
(Locked)
Using partials with EJS4m 56s
-
(Locked)
Template variables in more detail5m 57s
-
(Locked)
Looping through lists in templates11m 33s
-
(Locked)
Creating a list page6m 4s
-
(Locked)
Using parameter routes7m 9s
-
(Locked)
Challenge: Partials and lists2m 20s
-
(Locked)
Solution: Partials and lists8m 46s
-
(Locked)
-
-
-
-