Question: 1. Create a new folder for your task 2. Open up NPM inside the folder you just created 3. Add Express with pug to the

1. Create a new folder for your task 2. Open up NPM inside the folder you just created 3. Add Express with pug to the project using the express --view=pug command 4. Create a new folder called APP_SERVER 5. Create a models folder and a controllers folder inside APP_SERVER 6. Move the views folder and the routes folderfrom the root folder to inside the APP_SERVER folder 7. Open app.js and update it so it can find your views folder (which we just moved to the APP_SERVER folder) with: app.set('views', path.join(__dirname, 'app_server', 'views')); 8. Change the indexRouter variable to: const indexRouter = require('./app_server/routes/index'); 9. Make the same change you just did for indexRouterfor the userRouter variable 10. Open the controllers folder and create a new file called main.js 11. Add this code snippet to your main.jsfile: 12. Update index.jsin the routes folder creating a const ctrlMain which requires the new controller located at ../controllers/main 13. Modify the router.get function by removing the callback function (the second parameter function(req, res, next){})and replacing it with a reference to your controllers index function (See Listing 3.2 in the textbook) 14. Update the application so it says your name instead of Express by changing the main.jsfile 15. Install the dependencies using npm install 16. Run the server with npm start and show your professor the result.

Thats all the information we are provided in the pdf for task
dont know what snippet it means for line 11

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!