Day 98: 13 December 2020
The back pain is over so I can get back to work!
I need to finish writing my presentation for the 6th OpenClassRooms project.
So to avoid back pain again, today I have allocated only two hours that I can entirely devote to freeCodeCamp.
This way, I can divide my time with the Pomodoro Technique and I also realize my speed in writing code.
I use this simple Tomato Timer web application to track each session.
4 sessions of 25 minutes with 5 minutes break between each one = 2 hours
I already written the first three freeCodeCamp projects for the API & Microservices Certification:
I only have two more to go and today I started to write the Exercise Tracker Microservice.
With npm I installed three modules needed for the project:
I created a new database on MongoDB Atlas and configured the account and accesses.
I had also created a collection but actually it is not necessary, because by specifying a model, the collection is created automatically.
I created the schema for the user and for the exercises to be tracked.
Then I created the .env file so I could connect to MongoDB without having to share personal information using the npm dotenv module.
Also I added the nodemon module to the project but only in development mode and not in production writing:
npm install --save-dev nodemon
Once finished the preparation phase of the project I wrote some routes.
For the moment:
- We can
/api/exercise/new-userwith form data
usernameto create a new user. The returned response will be an object with
- We can make a
api/exercise/usersto get an array of all users. Each element in the array is an object containing a user's
- We can
/api/exercise/addwith form data
duration, and optionally
date. If no date is supplied, the current date will be used. The response returned will be the user object with the exercise fields added.
- mongoose Date type
- And this very comprehensive article that contains all the information that allows us to manipulate dates.
I also have finished writing my presentation!
There are two days left in this challenge and it feels like I just started yesterday….
**Link to tweet:**
**Link to work:**