This repository has been archived on 2025-07-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
duck-pond/backend
2022-10-30 11:25:24 +00:00
..
duckpond Update db.py 2022-10-30 11:25:24 +00:00
tests Add backend 2022-10-29 13:10:10 +01:00
poetry.lock Alter 2 files 2022-10-29 13:53:02 +01:00
pyproject.toml Alter 2 files 2022-10-29 13:53:02 +01:00
README.md Alter 3 files 2022-10-29 15:48:27 +01:00
requirements.txt Added CORS & map 2022-10-30 00:14:20 +01:00

Duck Pond backend

Endpoints

GET /entries

Gets a list of all the duck ponds in the database.

POST /entries/<id>/new

Creates a new duck pond entry.

JSON body arguments:

  • name - reqiured
  • location - required, in the form
    {
        "lat": -1.2345,
        "long": 33.56643
    }
    
  • imageURL

Votes will be initialised as zero.

Return sample:

{
    "id": "uuid"
}

PATCH /entries/<id>

Updates an entry with the ID id.

JSON body arguments:

  • name
  • location
  • imageURL
  • votes

GET /entries/<id>

Gets the JSON of the pond.

{
    "id": "uuid",
    "name": "The Pondiest Pond",
    "location": {
        "lat": -1.2345,
        "long": 33.56643
    },
    "imageURL": "https://example.com"
}