Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Open NPM in the directory you created for Task 1 2. Create two new files in the views folder, one called foodlist.pug and the

image text in transcribed

1. Open NPM in the directory you created for Task 1 2. Create two new files in the views folder, one called foodlist.pug and the other called favourite- food.pug 3. Copy all the code from index.pug into both files 4. Modify foodlist.pug so it contains a paragraph which says: "Here is a list of my favourite foods" instead of the "Welcome" message 5. Modify favourite-food.pug so it contains a paragraph which says: "Here is my favourite food" instead of the "Welcome" message 6. Create a new file in the controller folder called food.js 7. Create two functions using the same code as the index function in main.js, name one foodlist and name the other favourite Food 8. Change the title of foodlist so it says Food list and change the title of favourite Food so it says "My favourite food" 9. Change the foodlist template from 'index' to'foodlist' and change the favourite Food template from 'index' to'favorite-food' 10. Open the index.js file in the routes folder and add a new const called ctrlFood which references the food.js controller 11. Update the routes so that if the user goes to /favourite it calls ctrlFood.favourite Food and if the usergoes to /listit calls ctrlFood.foodlist 12. Run the server with npm start and show the result to your professor

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions