|
@ -18,3 +18,49 @@ _First make sure you have the docker service and docker-compose installed_ |
|
|
|
|
|
|
|
|
docker-compose up --detach |
|
|
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. |