Build a full stack JavaScript app that is functionally similar to this: https://exercise-tracker.freecodecamp.rocks.
- Express.js
- Node.js
- nodemon
- TypeScript, tsc
-
You can
POST
to/api/users
with form datausername
to create a new user. -
The returned response from
POST
/api/users
with form data username will be an object withusername
and_id
properties. -
You can make a
GET
request to/api/users
to get a list of all users. -
The GET request to
/api/users
returns an array. -
You can POST to
/api/users/:_id/exercises
with form datadescription
,duration
, and optionallydate
. -
If no
date
is supplied, the currentdate
will be used. -
The response returned from
POST
/api/users/:_id/exercises
will be the user object with theexercise
fields added. -
You can make a
GET
request to/api/users/:_id/logs
to retrieve a full exercise log of anyuser
. -
A request to a user's log
GET
/api/users/:_id/logs
returns a user object with a count property representing the number of exercises that belong to that user. -
A GET request to
/api/users/:_id/logs
will return the user object with a log array of all the exercises added. -
Each item in the log array that is returned from
GET
/api/users/:_id/logs
is an object that should have a description, duration, and date properties. -
The description property of any object in the log array that is returned from GET
/api/users/:_id/logs
should be a string. -
The duration property of any object in the log array that is returned from GET
/api/users/:_id/logs
should be a number. -
The date property of any object in the log array that is returned from GET
/api/users/:_id/logs
should be a string. Use thedateString
format of theDate API
. -
You can add from, to and limit parameters to a
GET
/api/users/:_id/logs
request to retrieve part of the log of any user. from and to are dates inyyyy-mm-dd
format. limit is an integer of how many logs to send back.
MIT | [email protected]