Primary tools used: NodeJS, Express, MongoDB and Mongoose.
- You can
POST
to/api/users
with form datausername
to create a new user. The returned response will be an object withusername
and_id
properties. - You can make a
GET
request to/api/users
to get an array of all users. Each element in the array is an object containing a user'susername
and_id
. - You can
POST
to/api/users/:_id/exercises
with form datadescription
,duration
, and optionallydate
. If no date is supplied, the current date will be used. The response returned will be the user object with the exercise fields added. - You can make a
GET
request to/api/users/:_id/logs
to retrieve a full exerciselog
of any user. The returned response will be the user object with a log array of all the exercises added. Each log item has thedescription
,duration
, anddate
properties. - A request to a user's log (
/api/users/:_id/logs
) returns an object with acount
property representing the number of exercises returned. - You can add
from
,to
andlimit
parameters to a/api/users/:_id/logs
request to retrieve part of thelog
of any user.from
andto
are dates inyyyy-mm-dd
format.limit
is an integer of how many logs to send back.