learn-co-curriculum / basic-apis-lab

Other
0 stars 1 forks source link

Basic APIs Lab

Objectives

  1. Set up a Github API app.
  2. Read API documentation and figure out API calls.
  3. Use Faraday to make GET requests from the Github API.
  4. Read the response and display certain elements on a page.

Instructions

We're going to create a Rails application that will allow the user to search for Github repositories via the Github API.

The basic Rails app has been provided. You'll need to implement the API parts and make the tests pass. This lab will test your documentation reading skills as well as your coding skills!

  1. Set up a Github app and get a Client ID and Secret for use with this lab.
  2. Update the RepositoriesController and use Faraday to query the Github repository search. Use your client ID and secret for the request.
  3. Display the search results on the page. Include the name, a link to the repository, and the description.
  4. Try it out, and make sure all tests pass!

Top-tip: Dotenv is a great way to keep configuration variables for development, but always remember to add .env to your .gitignore so you don't share your secrets with everyone else!