Giter Site home page Giter Site logo

player-api's Introduction

Player DB Microservice

Your assignment is to create a microservice which serves the contents of the People.csv through a REST API. You are free to choose whatever programming language you are comfortable with, SDKs, web frameworks, databases, and online resources to complete this exercise.

Requirements:

  • Provide a REST API to your service
  • Package the application for distribution. Some examples of this:
    • Docker image (preferred)
    • Tomcat WAR
    • Static binary
    • others...

REST API

The service should expose two REST endpoints:

  • GET /api/players - returns the list of all players
  • GET /api/players/{playerID} - returns a single player by it's ID

Given a player line of the CSV file:

playerID,birthYear,birthMonth,birthDay,birthCountry,birthState,birthCity,deathYear,deathMonth,deathDay,deathCountry,deathState,deathCity,nameFirst,nameLast,nameGiven,weight,height,bats,throws,debut,finalGame,retroID,bbrefID
aardsda01,1981,12,27,USA,CO,Denver,,,,,,,David,Aardsma,David Allan,215,75,R,R,2004-04-06,2015-08-23,aardd001,aardsda01

The json representation of a player should be the following, where each field name is equal to the CSV column name:

{
  "playerID":"aaronha01",
	"birthYear":1934,
	"birthMonth":2,
	"birthDay":5,
	"birthCountry":"USA",
	"birthState":"AL",
	"birthCity":"Mobile",
	"deathYear":0,
	"deathMonth":0,
	"deathDay":0,
	"deathCountry":"",
	"deathState":"",
	"deathCity":"",
	"nameFirst":"Hank",
	"nameLast":"Aaron",
	"nameGiven":"Henry Louis",
	"weight":180,
	"height":72,
	"bats":"R",
	"bbthrows":"R",
	"debut":"1954-04-13",
	"finalGame":"1976-10-03",
	"retroID":"aaroh101",
	"bbrefID":"aaronha01"
}

Bonus Requirements:

The service should expose two additional REST API endpoint:

  • PUT /api/players/{playerID}/weight - increments a player's weight by 1
  • PUT /api/players/{playerID}/height - increments a player's height by 1

The request and response payloads of these endpoints can be an empty JSON dictionary: {}

player-api's People

Contributors

alpsendil 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.