Skip to content
Harry Turnbull edited this page May 30, 2020 · 1 revision

Mission Ctrl API

This is a backend API for the Mission Ctrl game.

Tech Stack

  • Express
  • Mongoose
  • MongoDB
  • Node

API

Submit a score

POST to /scores route, json body:

{
  "name": "Dave",
  "score": 100,
}

Expected response status 200, response body:

{
  "_id": "5ed22c319a146a4ad81453d6",
  "name": "Dave",
  "score": 100,
  "date": "2020-05-30T09:49:37.375Z",
  "__v": 0
}

Get all scores

GET to /scores route, expected response status 200, response body:

[
  {
    "_id": "5ed22c319a146a4ad81453d6",
    "name": "Dave",
    "score": 100,
    "date": "2020-05-30T09:49:37.375Z",
    "__v": 0
  },
  {
    "_id": "5ed139a7e7936a50fa921e20",
    "name": "Jim",
    "score": 100,
    "date": "2020-05-29T16:34:47.085Z",
    "__v": 0
  }
]
Clone this wiki locally