JSON Web Server
Due: 11:00pm, Wednesday March 2, 2022
Description
The goal for this assignment is to create an ExpressJS application that returns JSON data. We will use the dataset from the second assignment to implement the following GET routes:
/
Return the entire dataset as an array of objects.
/:id
Return the object with the corresponding ID. If the ID does not exist send a 404 status code with a JSON object containing an error message.
/type/:type
Return an array of objects where the type matches the parameter. If the type does not exist send a 404 status code with a JSON object containing an error message.
Here is a link to the ExpressJS Request object documentation The relevant method for request parameters is req.params()
.
Here is a link to the ExpressJS Response object documentation. Relevant methods include res.json()
and res.status()
.
Note that the server must run on port 3000.
Turning in the Assignment
For this assignment, you must turn in a zip file of a directory named assignment4
containing all the files needed to run the application. Submit the zip file to the appropriate folder on D2L.
Grading Criteria
Grading (out of 100 points):
- 10 points – Documentation
- 10 – complete documentation that follows the standards
- 5 points – incomplete documentation and/or documentation that does not follow the standards
- 0 points – no documentation
- 60 points – Implementation
- 60 points – correct implementation
- 30 points – partially correct implementation
- 0 points – incorrect implementation
- 30 points – Program output
- 30 points – correct program output
- 15 points – partially correct program output
- 0 points – incorrect program output