Question: 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

 1. Open NPM in the directory you created for Task 1

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!