-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Happy Thoughts API Project - Elina Eriksson Hult #505
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job with this project and a proper full stack one.
Keep it up!
const endpoints = listEndpoints(app); // Automatically list all endpoints | ||
res.json({ | ||
message: "Hello and welcome to the Happy Thoughts API! Here are all the available endpoints:", | ||
endpoints: endpoints | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat and structured
app.get("/thoughts", async (req, res) => { | ||
try { | ||
const thoughts = await Thought.find() | ||
.sort({ createdAt: -1 }) // Sort in descending order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.sort({ createdAt: "desc" })
this would be another way to do it
Backend Render link:
https://project-happy-thoughts-api-pxns.onrender.com
Frontend Netlify link:
https://happythoughtselina.netlify.app/