Code Monkey home page Code Monkey logo

bishop's Introduction

Bishop (code challenge)

Our objetive is create an api that joins different sources of data.

Clash: http://www.clashapi.xyz/api/cards/{id} // json

  • images: /images/cards/{id|idName}.png

Pokemon: https://pokeapi.co/api/v2/pokemon/{id} // json

Drivers: http://ergast.com/api/f1/drivers/{id} // xml

  • url: Driver:url

Prologue

In this exercise, app is based on: Express. If you are not familiar with it you can check the documentation in the following link:

Around these libraries, we've created a few components and basic structure for the project. Here we have some highlights of the structure of the project.

  • /controllers As any other express application you can find under this folder basic routers for different entities.

Run

First at all, clone the repo using the button at the top. Or if you prefer, you can fork the project.

screen shot 2019-01-09 at 5 49 43 pm

Then, you need to install all the packages npm install. If you want to start, you can run the application with npm start.

Exercise

Create an endpoint called items. This endpoint shall group all the information previously mentioned. The goal is normalize the output of those APIs. In order to do that, we are going to reduce the information provided to:

  • id unique id which is going to be used for more information
  • name display name

Then our endpoint /items/ is going to return a JSON with the next structure:

[
    {
        "id": "some-id",
        "name": "whatever",
    },
    ...
]

Next steps

Aditionally, our clients want to retrieve a little more information from this items. To achieve that goal, we are going to create and endpoint for that purpose.

/items/:id

In this case, we want to reply with the following structure:

{
    "id": "some-id",
    "image": "://url/to/image",
    "name": "whatever",
}

As our drivers API doesn't have any images, we are going to display in image field the url for their wikipedia sites.

Tips

Optional

  • Use some cache system
  • Use some reverse id system

bishop's People

Contributors

sergiogreyes avatar

Watchers

James Cloos 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.