From 933176a370913c1aded4b144834352d04254a5b1 Mon Sep 17 00:00:00 2001 From: Haris Razis Date: Sun, 3 Jan 2021 16:07:44 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9C=20Update=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index 02e3e40..255349d 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,49 @@ _First make sure you have the docker service and docker-compose installed_ docker-compose up --detach +# Server endpoints + +## Authentication + +**POST** `/auth/login` + +If the user exists in the DB, a new session is initiated. Else if the user is not registered, user is saved then a new +session initiates. + +**POST** `/auth/logout` + +Logouts current user. + +**GET** `/auth/current_user` + +Returns current user. + +## API + +### Athletes + +**GET** `/api/athletes` + +Returns an array of athletes objects. + +**GET** `/api/athlete/{user._id}` + +Returns an athlete object for a given _id. + +**GET** || **PUT** `/api/athlete/{user._id}/edit` + +Edits an athlete matching the given _id. + +**DELETE** `/api/athlete/{user._id}` + +Deletes an athlete matching the given _id. + +### Data + +**GET** `/api/data` + +Returns all data in the specified time range. + +**GET** `/api/data/{user._id}` + +Returns all data for a given user _id, in the specified time range. \ No newline at end of file