Hi,
This is the Exercise Tracker example from freeCodeCamp.
Is this project works as expected? Because I not able to test the User story 4.:
4. I can retrieve a full exercise log of any user by getting /api/exercise/log with a parameter of userId(_id). Return will be the user object with added array log and count (total exercise count).
Thank you. I could not get the example to work and was trying to figure out the endpoints.
I believe this project is broken in many ways. The first being the the clarity of the the challenge and the goal. Maybe that is the point? To figure out the goal & endpoints?
#2 the validation is broken; You can put in any link and it will pass. (makes debugging difficult)
#3 the âboiler-plateâ is very bloated and was broken for me. it took me way too long (and frustration) to look into the provided code. Again, maybe that is the point. Iâve yet to âcompleteâ the challenge to my liking but will continue on the path I think it is suppose to go.
If you are stuck early on in this challenge & âremixingâ the Glitch project:
if using the MONGO db from the lessons (the .env variable may be different); triple-check line 8 âmongoose.connectâŚâ
activate the âlistenerâ at the end of the code. Itâs defined but never called.
there are a pair of âmiddleware/error handlersâ provided⌠leave them at the bottom. I thought they were for the testing, but I was wrong and all routes defaulted to them. (another learning moment about the routes)
Here is a little extra front-end for the HTML I am using (add around line 30, after the last form.). (this is what I am using to help complete the project! NOT VERIFIED WORKING)
Again, not sure if half this challenge is about âjust making it workâ ⌠but unfortunately any entry to the challenge passes.
<form action="/api/exercise/users" method="get">
<h3>List of Usernames & Unique IDs</h3>
<p><code>GET /api/exercise/users</code></p>
<input type="submit" value="Get Users">
</form>
<form method="get">
<h3>Get History by *ID*</h3>
<p><code>GET /api/exercise/log?userId={userId}</code></p>
<input id="uidlookup" type="text" name="userId" placeholder="**userID**">
<input type="submit" value="Look Up by ID #" onclick="this.form.action='/api/exercise/log'">
</form>
Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isnât already an issue for it and provide as much detail as possible.
Thanks very much for this. Dear freeCodeCamp team, you should update both the spec of the /api/exercise/add and the reference implementation to reflect the fact that â_idâ property is expected in the response and not the âuserIdâ.