From the course: Building a Website with Node.js and Express.js

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using parameter routes

Using parameter routes

From the course: Building a Website with Node.js and Express.js

Start my 1-month free trial

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