From the course: Mastering Nest.js: Build Scalable Applications with Mastery in Nest.js Framework
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Configuring edit product route - Nest.js Tutorial
From the course: Mastering Nest.js: Build Scalable Applications with Mastery in Nest.js Framework
Configuring edit product route
Now, let's start working on the edit product page and route. We have already created the edit product template, so let's just render it. I'll open the app controller file and define the get route handler, setting the path as edit product and a method that is render edit product page, which returns null. Then I'll render the edit product template. Now inside the home EJS file, where we have defined the anchor for edit product, I'll give the href slash my store slash edit product. Let's save and check the browser. We have opened the home page. Let me click on edit option. And here we go. We are redirected to the edit product template, which you can see in the route path. Now let's also display the navbar inside the edit product page. I'll open the edit product template and inside the body, I'll give the scriptlet include the path dot slash includes slash navbar dot ejs. And let's also place the bootstrap CD and links from the home EJS template inside the edit product page. Let's save…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Introduction to MyStore application2m 43s
-
(Locked)
Rendering template on server4m 41s
-
(Locked)
Creating navbar with "includes"3m 31s
-
(Locked)
Creating home interface9m 6s
-
(Locked)
Conditional rendering: No product found2m 26s
-
(Locked)
Configuring add product route2m 29s
-
(Locked)
Creating "add product" interface5m 51s
-
(Locked)
Configuring edit product route1m 49s
-
(Locked)
Interface & functionality: Edit product4m 10s
-
(Locked)
-
-
-
-