Professional Documents
Culture Documents
1. Continue working on the project you created for the previous assignment
2. Open the APP_API/controllers/ folder and modify all the CRUD placeholder functions so
they interact with the database now. You should be able to perform the following tasks
with the database: get a single item, get all items, delete an item, update an item,
create an item. You can test if they work using Postman.
3. Open the APP_SERVER/controllers folder and modify the controller so that it gets
responses from the API and renders the correct pages. You will need to at least render/
get responses for a list, a details page (which displays data from a single item), and a
create page.
NOTE:
a. "Request" needs to be installed and referenced in the controller
(see Section 7.1.1)
b. The "apiOptions" also needs to be added to the controller
(see Section 7.1.2)
4. Open the APP_SERVER/views folder and modify list.pug so it displays the names of the
entire list of data and allows you to click each one taking you to its details page.
5. Create a details.pug which displays all the fields of a single item and a create.pug which
contains a form that allows you to create a new item.
NOTE: Don't forget to add the Create page to your nav.
6. Edit the APP_SERVER/routes/index.js file to add routes for the following: a page for the
item id, which maps to the controller that displays the details page and a /new route
for creating a new entry.
7. Improve the design of the new pages you created (the form and the details).
Please refer to the Assignment Rubric for a breakdown of the marking for this Assignment.