Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 5.27 KB

README.md

File metadata and controls

42 lines (33 loc) · 5.27 KB

Anywhere-Fitness

Front-End:

https://github.com/anywhere-fitness-tt2/Front-end

Deployed Site:

https://anywhere-fitness-tt2.vercel.app/

Auth End-Points

AUTH URL Requires Restrictions Returns
POST /api/auth/register -username
-email
-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

User End-Points

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

Class End-Points

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