Skip to content

Happy Thoughts API Project - Elina Eriksson Hult#505

Open
ElinaEH wants to merge 8 commits intoTechnigo:masterfrom
ElinaEH:master
Open

Happy Thoughts API Project - Elina Eriksson Hult#505
ElinaEH wants to merge 8 commits intoTechnigo:masterfrom
ElinaEH:master

Conversation

@ElinaEH
Copy link
Copy Markdown

@ElinaEH ElinaEH commented Dec 20, 2024

Copy link
Copy Markdown

@JennieDalgren JennieDalgren left a 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!

Comment thread server.js
Comment on lines +52 to +57
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
});
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat and structured

Comment thread server.js
app.get("/thoughts", async (req, res) => {
try {
const thoughts = await Thought.find()
.sort({ createdAt: -1 }) // Sort in descending order
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants