Node/Express Lesson 7 Coding Assignment

Continue to work in the node-express-course repository. Create a new branch, week7. This should be created when the week6 branch is active, so that your new work adds to the previous work. You work in the directory 04-store-api/starter. Once you have changed to that directory, be sure to run npm install to install the required node modules. As in previous lessons, you duplicate the work of the instructor, testing as you go with Postman.

This is a difficult lesson, so take your time with it, stopping the video as needed so that you understand what is being done. Also, if you get stuck, the instructor’s solution is in the 04-store-api/final directory. The idea is that one can search by any or all of these attributes: featured, name, price, rating, company. For the numeric fields price and rating, one can also specify greater than, less than, or equal to. One can also specify a sort order. Also one can specify a skip and a limit, to facilitate pagination through the result. Be sure that you test each step with Postman. Almost all of the work is in the controllers/product.js. That file has two methods, getAllProducts and getAllProductsStatic. The getAllProductsStatic method is just for experimentation.

This site needs some love. Come contribute; we're open to contributors! Come lend a hand!