Documentation can be found on : https://github.com/viktoriussuwandi/Exercise-Tracker
This is the result to complete the Exercise Tracker project. Instructions for building this project can be found at https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/exercise-tracker
* Avoid duplicate username
* Avoid duplicate user_id using recursive function
* Using local file to save user input
* Using id generator to generate user id
* Using express validator to validate user input
- You should provide your own project, not the example URL.
- You can POST to /api/users with form data username to create a new user.
- The returned response from
POST/api/userswith form datausernamewill be an object withusernameand_idproperties. - You can make a
GETrequest to/api/usersto get a list of all users. - The
GETrequest to/api/usersreturns an array. - Each element in the array returned from
GET/api/usersis an object literal containing a user'susernameand_id. - You can POST to
/api/users/:_id/exerciseswith form datadescription,duration, and optionallydate. If no date is supplied, thecurrent datewill be used. - The response returned from
POST/api/users/:_id/exerciseswill be the user object with the exercise fields added. - You can make a
GETrequest to/api/users/:_id/logsto retrieve a full exercise log of any user. - A request to a user's log
GET/api/users/:_id/logsreturns a user object with acountproperty representing the number of exercises that belong to that user. - A
GETrequest to/api/users/:_id/logswill return the user object with alogarray of all the exercises added. - Each item in the
logarray that is returned fromGET/api/users/:_id/logsis an object that should have adescription,duration, anddateproperties. - The
descriptionproperty of any object in thelogarray that is returned fromGET/api/users/:_id/logsshould be a string. - The
durationproperty of any object in thelogarray that is returned fromGET/api/users/:_id/logsshould be a number. - The
dateproperty of any object in thelogarray that is returned fromGET/api/users/:_id/logsshould be a string. Use thedateStringformat of theDateAPI. - You can add
from,toandlimitparameters to aGET/api/users/:_id/logsrequest to retrieve part of the log of any user.fromandtoare dates inyyyy-mm-ddformat.limitis an integer of how manylogsto send back.