Sign inSign up

cintrab98/api-nba

By cintrab98

Updated over 2 years ago

Backend Docker for a Node.js REST API with Express and MySQL.

Image
Languages & frameworks
API management
Web servers
1

102

cintrab98/api-nba repository overview

PORT=3000

CONNECTION_STRING=mysql://root:1998@db-api-nba:3306/nba_api_node_database

Endpoints
  • Teams

    • GET /teams: Retrieves all teams.

    • GET /teams/:id: Retrieves a specific team by ID.

    • GET /teams/search: Retrieves filtered teams based on search parameters.

    • POST /teams: Creates a new team.

    • PUT /teams/:id: Updates an existing team by ID.

    • DELETE /teams/:id: Deletes a team by ID.

  • Statistics

    • GET /stats: Retrieves all statistics.

    • GET /stats/:id: Retrieves specific statistics by team ID.

    • GET /stats/search: Retrieves filtered statistics based on search parameters.

    • PUT /stats/:id: Updates existing statistics by team ID.

Teams Table

Example JSON for adding and updating teams.

json
{
    "team":"CHICAGO BULLS",
    "conference":"Leste",
    "wins":"37",
    "losses":"42",
    "value":"2.35",
    "coach":"Billy Donovan",
    "team_age":"26.4",
    "team_height":"200.70",
    "team_wingspan":"207.30"
}

Statistics Table

Example JSON for updating statistics of a team.

json
{
    "team_age": "22",
    "team_height": "80.43",
    "team_wingspan": "210.10"
}
commands
$ docker network create net-api
$ docker run --network net-api -dp 127.0.0.1:3000:3000 cintrab98/api-nba:1.2

Tag summary

Content type

Image

Digest

sha256:25545a817

Size

385.7 MB

Last updated

over 2 years ago

docker pull cintrab98/api-nba:1.2