Question: Create a new express router to handle all requests to / users , and use it in the application, the endpoint / users should return
Create a new express router to handle all requests to users and use it in the application, the endpointusers should return all users.
Add a new route userscreate that will add a new user to the users array, and create a routerlevel middleware function that will log the request body if found use the correct HTTP method
Create a new express router to handle all requests to products and use it in the application.
Create a products array that has the following items keyboard, mouse and then add a route to update the items productsupdate in the array, it should replace one of the values with the new value use the correct HTTP method
Create a new routerlevel middleware attached on the products router that will log the products router request path at every HTTP request.
Create an applicationlevel errorhandling middleware, that has the message of NOT FOUND and a status code of and that will be called when trying to access unassigned endpoints.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
