- Title
- Deployed Link
- Site Picture
- Technologies Used
- Description
- Work Involved
- Code Snippet
- License
- Authors
- Questions
- Acknowledgments
- Click this link to view the site. Deployed Link
- Mongoose
- javascript
- CSS
- HTML
- Express
- Morgan
- NodeJs
- Robo3T
- Atlas
- Heroku
- Github
This application allows a user to track their daily workouts. They can log multiple exercises on a specific day, track the name, type, sets, reps, and duration of exercise, and track distance traveled if they did a cardio workout.
For this application, I developed the html routes in order to render the different html pages. I created a workout model in order to store the exercise information within the database. I also constructed the api routes to allow for functionality within the site.
- This particular code snippet demonstrates how a user can update the workout model.
router.put("/api/workouts/:id", (req, res) => {
Workout.findByIdAndUpdate(
{ _id: req.params.id },
{ $push: { exercises: req.body } },
{ new: true, runValidators: true },
console.log(req.params.id)
).then(dbWorkout => {
console.log(dbWorkout);
res.json(dbWorkout);
})
.catch(err => {
res.status(400).json(err);
});
res.json(req.params.id);
});
This project is covered under MIT.
UC Berkeley Coding Bootcamp
Jessny Joseph
Trilogy Education Services