W02 Team Activity: Add Documentation to an API
Overview
For this team activity, your group will be given a Node.js project similar to the one you've been working on and add API documentation to it.
- Download this project as your starting point.
- Examine the code. For this assignment you will only worry about the temple routes.
- Create a new collection in MongoDB called temples.
- Import the temples.json file into your new temples collection.
- Adjust the .env file so that you can successfully run npm start and connect to the database.
- Create a new Swagger file and add documentation for each route you see there. There are many ways to do this, but this swagger-autogen package may be useful.
- Generate a visual UI and living documentation of your swagger.json. There are many ways to do this, but this swagger-ui-express package may be useful.
- Now that you have documented the routes that are existing, talk with your team about what routes are missing. Add these routes to the API documentation.
- Regenerate your swagger.json, and restart your server. Test these routes in the Swagger UI by selecting the "Try it Out" then "Execute" buttons.
Review a Sample Solution
Once you have completed the steps above, review the sample solution below and compare/contrast your approach.
Submission
When you are finished:
- Return to Canvas to take the quiz to report on this activity.
Other Links:
- Return to: Week Overview | Course Home