Assignment 10

For this assignment, you are going to build a single API endpoint in Express that fetches and caches data from a GitHub API endpoint.

The endpoint you are going to build will be GET /api/github/:username, where :username can be filled in with a GitHub username (e.g. /api/github/skaterdav85). When you make a request to this endpoint, use the :username variable in the URL to make a request to https://api.github.com/users/skaterdav85 (where skaterdav85 will be whatever :username contains) using Axios. Extract out the public_repos property in the response and write it out to a file named after the requested username (e.g. skaterdav85.txt). Your endpoint should respond with JSON structured as follows, where reposCount contains the value from public_repos:

{
  "repoCount": 121
}

Subsequent requests to this endpoint for the same username should read the repo count from the file instead of making a request to the GitHub API and should still respond with the response above.

Code Requirements

Submission

Create a short video using Zoom where you demo your endpoint. Please use 2 different GitHub usernames in your video demo. Create a brand new repository for this assignment. Send an email to Brighton and me with the URL to your GitHub repository and the link to your Zoom video with the subject: “ITP 405 - Assignment 10”.