Coder Social home page Coder Social logo

api_practice_app's Introduction

API Wrapper (RAWG.IO)

A mini project for practicing API wrappers (Avion school rails activity)

image

Additional Sources:

Documentation link: https://api.rawg.io/docs/

How to use API?

Create your own account in RAWG.IO to get your own API KEY.
Clone repo into your local machine
git clone https://github.com/mumble-07/api_practice_app.git
Run bundle install
Gem used for this wrapper: REST CLIENT API (https://github.com/rest-client/rest-client)
bundle install

Configuration

It is best practice not to push your own API key, so the key used in this mini project is hidden in credentials. Make sure to add your own API key to your own credential.

Run

EDITOR="code --wait" rails credentials:edit
Add this inside your credential file.
rawg_api:
  RAWG_API_TOKEN: <YOUR API KEY HERE>
As you can see inside the request.rb (filepath:

app/api/rawg/request.rb) , the TOKEN was declared as this:

TOKEN = Rails.application.credentials.rawg_api[:RAWG_API_TOKEN]
This is to access the API TOKEN you put in your credentials.

Run

rails s

TESTING

You may now test the API wrapper, make sure rails server is running.
You may also test this via postman.
Postman documentation used for this mini project: https://documenter.getpostman.com/view/15112734/UUy38mVq

Available Routes

    get '/creator-roles' => 'creator_roles#index'
    get '/developers' => 'developers#index'
    get '/games' => 'games#index'
    get '/genres' => 'genres#index'
    get '/platforms' => 'platforms#index'
    get '/platforms/lists/parents' => 'parents_platforms#index'
    get '/publishers' => 'publishers#index'
    get '/stores' => 'stores#index'
    get '/tags' => 'tags#index'

api_practice_app's People

Contributors

mumble-07 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.