christophermilian / nodejs-express-exercise-tracker

Solution to the exercise tracker project in freeCodeCamp Backend API course.

Home Page:https://www.freecodecamp.org/learn/back-end-development-and-apis/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nodejs-express-exercise-tracker

Description

A Nodejs full stack application that tracks exercise behavior.

Available Endpoints

  1. GET: /api/users
  2. GET: /api/users/:_id/logs
  3. POST: /api/users
  4. POST: /api/users/:_id/exercises

Examples

  • http:localhost:<port>/api/users
    [
        {
            "_id": "6567eb0c01415096fb41f9df",
            "username": "chrismilian26",
            "__v": 0
        },
        {
            "_id": "6567f3578b333fa8e92bfbdf",
            "username": "apple50",
            "__v": 0
        },
    ]
    
  • http:localhost:<port>/api/users/6567eb0c01415096fb41f9df/logs?from=2023-10-01&to=2023-10-29&limit=10
    • from are to are optional dates of format yyyy-mm-dd
    • limit is optional number
    {
      "username": "chrismilian26",
      "count": 2,
      "_id": "6567eb0c01415096fb41f9df",
      "log": [
          {
              "description": "test",
              "duration": 60,
              "date": "Wed Nov 29 2023"
          },
          {
              "description": "waves",
              "duration": 40,
              "date": "Fri Nov 10 2023"
          },
      ]
    }
    
  • http:localhost:<port>/api/users
    {
      "username": "chrismilian26"
    }
    
  • http:localhost:<port>/api/users/6567eb0c01415096fb41f9df/exercises
     {
      "description": "Bike around",
      "duration": "30",
      "date": "2023-10-13"
     }
    

Installation

$ npm install

Running the app

# development
$ npm run start

License

MIT licensed

About

Solution to the exercise tracker project in freeCodeCamp Backend API course.

https://www.freecodecamp.org/learn/back-end-development-and-apis/

License:MIT License


Languages

Language:JavaScript 60.1%Language:HTML 30.1%Language:CSS 8.9%Language:Shell 0.9%