CSE 341: Web Services

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.

  1. Download this project as your starting point.
  2. Examine the code. For this assignment you will only worry about the temple routes.
  3. Create a new collection in MongoDB called temples.
  4. Import the temples.json file into your new temples collection.
  5. Adjust the .env file so that you can successfully run npm start and connect to the database.
  6. 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.
  7. 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.
  8. 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.
  9. 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.

Sample Solution

Video Walkthrough:

Submission

When you are finished:

Other Links: