Project-api hand in#51
Conversation
HIPPIEKICK
left a comment
There was a problem hiding this comment.
Some missing requirements:
- Possibility to edit and delete in frontend
- Thoughts are not saved (when refreshing the frontend, my newly created thought is gone)
|
@HIPPIEKICK The thoughts were saved but they were puplished at the and of the site, not at the beginning, so you probably just didnt see them. My bad. They are now at the top of the thoughts list. to: const thoughts = await Thought.find().sort({ createdAt: -1 }) I had the PUT and DELETE already in backend, lacked in frontend though. I will fix! |
|
@HIPPIEKICK I think I have fixed everything, let me know if its not working :) |
|
Nice work with the API and the frontend. I found a couple of things to look at Single thought route has a typo File: In the route for But later it tries to send back
You can fix it by sending back the variable that actually exists: res.status(200).json(thoughts);(I had some AI help on this) Also, after sending a 404 response, it is good to add
File: The old root That can be a problem because many people will try to run the project from the repo root with: npm install
npm startRight now that may fail, because the main One fix would be to keep the API setup in the root folder, or add root scripts that start the backend.
File: Right now, if there is no token, the app only shows the login form. That means visitors cannot see the happy thoughts list, like thoughts, or visit the About page unless they log in first. For this project, it would be better if everyone can see and like thoughts. Login can still be needed for posting, editing, and deleting. The biggest things to fix are:
|

https://js-project-api-i97g.onrender.com
https://project-happy-thoughts-api.netlify.app/