Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Assignment 1 - Node Modules, Express and REST API

Task 1

• Update the Node module named dishRouter.js to implements the Express router
for the /dishes/:dishId REST API end point.

• The REST API supports GET, PUT, POST and DELETE operations on
/dishes/:dishId end point.

◆ Send request to: /dishes/1

◆ Method: GET
◆ Send request to: /dishes/1
◆ Method: POST

◆ Send request to: /dishes/1


◆ Method: PUT
◆ Send request to: /dishes/1
◆ Method: DELETE

Task 2

• Create a Node module named promoRouter.js that implements the Express router
for the /promotions and /promotions/:promoId REST API end points.
• The REST API supports GET, PUT, POST and DELETE operations on
/promotions

◆ Send request to: /promotions


◆ Method: GET
◆ Send request to: /promotions
◆ Method: POST
◆ Send request to: /promotions
◆ Method: PUT

◆ Send request to: /promotions


◆ Method: DELETE
• The REST API supports GET, PUT, POST and DELETE operations on
/promotions/:promoId end points.

◆ Send request to: /promotions/1


◆ Method: GET

◆ Send request to: /promotions/1


◆ Method: POST
◆ Send request to: /promotions/1
◆ Method: PUT

◆ Send request to: /promotions/1


◆ Method: DELETE
Task 3

• Create a Node module named leaderRouter.js that implements the Express router
for the /leaders and /leaders/:leaderId REST API end points.

• The REST API supports GET, PUT, POST and DELETE operations on /leaders

◆ Send request to: /Leaders


◆ Method: GET
◆ Send request to: /Leaders
◆ Method: POST
◆ Send request to: /Leaders
◆ Method: PUT

◆ Send request to: /Leaders


◆ Method: DELETE
• The REST API supports GET, PUT, POST and DELETE operations on
/leaders/:leaderId end points.

◆ Send request to: /Leaders/1


◆ Method: GET

◆ Send request to: /Leaders/1


◆ Method: POST
◆ Send request to: /Leaders/1
◆ Method: PUT

◆ Send request to: /Leaders/1


◆ Method: DELETE

You might also like