-
- Let you register, login, and edit users
- Create, review, update, and delete workout data
- Name of exercise
- Region of body workout targets
- Weight lifted
- Amount of reps and sets completed
- Date completed
- Ease of use, convenience, and accountability!
- | Method | URL | Description
https://bw-weight-lifting-journal.herokuapp.com
- | POST | /api/auth/register | Registers a user using the information sent inside the
request bodyin/json/. Example body: { "username": "TheOfficialAdmin", "password": "adminpassword", "department": "Admin" }departmentcan be eitherStudentorAdmin. - | POST | /api/auth/login | Logs in a user using the information sent inside the
request bodyin/json. Example body: { "username": "TheOfficialAdmin", "password": "adminpassword" }. Should return a cookie that expires in 1 day - | GET | /api/auth/logout | Logs user out, deletes cookie.
Must be logged in as Admin, OR as user with ID in params
- | GET | /api/users | Returns an array of all the user objects contained in the database.
- | GET | /api/users/:id | Returns the user object with the specified
id. - | DELETE | /api/users/:id | Removes the user with the specified
idand returns the deleted user. - | PUT | /api/users/:id | Updates the user with the specified
idusing data from therequest body. Returns the modified document.
NOT Restricted
- | GET | /api/workouts/:id | Takes
User IDas a parameter. Returns list of specified workouts (including all reps/sets/etc). - | POST | /api/workouts | Adds a workout to workouts using information sent inside the
request bodyin/json/. Example body: { "user_id": "1", "workout_name": "Curls", "muscle_group": "biceps", "weight": "30.0", "reps": "10", "sets": "3", "date_created": "Jan 9th 2020" }user_id,workout_name, anddate_completedare required A workout id will be created automatically, and can be used to edit/delete. - | PUT | /api/workouts/:id | Takes
Workout IDas a parameter. Updates the workout using information sent inside therequest bodyin/json/. - | DELETE | /api/workouts/:id | Takes
Workout IDas a parameter. Deletes the user's workout.