Skip to content
This repository was archived by the owner on Jun 7, 2022. It is now read-only.
This repository was archived by the owner on Jun 7, 2022. It is now read-only.

Statistics backend (first iteration) #37

@vladbat00

Description

@vladbat00

Endpoints

GET /statistics

Parameters

  • player
    • type: string
    • required: false

Response

  • If player parameter is present, return top 10 of all players ordered by score, 4 players before the best player score
  • If player parameter is absent, return top 20 of all players ordered by score

Example:

[
  {
    "player": "Player 1",
    "score": 100,
  },
  // ... 13 other results
  {
    "player": "You",
    "score": 12,
  },
  // ... 4 other results
]

POST /statistics

Parameters

  • player
    • type: string
    • required: true
  • score
    • type: number
    • required: true

Response

  • If player isn't present in the DB, create a new record
  • If player is already present in the DB and the submitted score is higher, update the score
OK 200

Metadata

Metadata

Assignees

Labels

webWeb backend for statistics and lobby

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions