https://github.com/anywhere-fitness-tt2/Front-end
https://anywhere-fitness-tt2.vercel.app/
Base Url: https://af-api-tt2.herokuapp.com/
AUTH | URL | Requires | Restrictions | Returns |
---|---|---|---|---|
POST | /api/auth/register | -username -password -role |
None | Newly created user with auto-generated userId |
POST | /api/auth/login | -username -password |
None | Logged in user data and JWT token for authorization |
Users | URL | Requires | Restrictions | Returns |
---|---|---|---|---|
GET | /api/users/ | N/A | -Valid Token | Object Array of all Users (instructors & students) |
GET | /api/users/:id | N/A | -Valid Token | Individual user object |
GET | /api/users/:id/classes | N/A | -Valid Token | Object array of a user's enrolled classes |
PUT | /api/users/:id | -Any of the keys (ex. username) |
-Valid Token | Single object of updated user's data |
DELETE | /api/users/:id | N/A | -Valid Token | Deleted user |
POST | /api/users/enrollment | -The classID of the class the currently logged in user wants to enroll in |
-Valid Token | Success/Error message |
DELETE | /api/users/enrollment/:id | N/A | -Valid Token | Success/Error message |
Classes | URL | Requires | Restrictions | Returns |
---|---|---|---|---|
GET | /api/classes/ | N/A | -Valid Token | Object Array of all Classes |
GET | /api/classes/:id | N/A | -Valid Token | Individual class object |
GET | /api/classes/:id/students | N/A | -Valid Token | Object array of the currently enrolled students in the class |
GET | /api/classes/:id/instructors | N/A | -Valid Token | Object array of the instructor(s) for the class |
POST | /api/classes/ | -name -type -time -duration -intensityLvl -location -attendees (integer) -maxSize (integer) |
-Valid Token -Can only be used when currently logged in as an instructor |
Single object of newly created class |
PUT | /api/classes/:id | -Appropriate keys with changed values |
-Valid Token -Can only be used when currently logged in as an instructor |
Single object of updated class data |
DELETE | /api/classes/:id | N/A | -Valid Token -Can only be used when currently logged in as an instructor |
The deleted class |