Skip to content

Nella: Happy API#508

Open
nella-x wants to merge 3 commits into
Technigo:masterfrom
nella-x:master
Open

Nella: Happy API#508
nella-x wants to merge 3 commits into
Technigo:masterfrom
nella-x:master

Conversation

@nella-x

@nella-x nella-x commented Dec 22, 2024

Copy link
Copy Markdown

@HIPPIEKICK HIPPIEKICK self-assigned this Jan 9, 2025

@HIPPIEKICK HIPPIEKICK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good job Nella! 💯

Comment thread server.js
Comment on lines +70 to +73
const updatedThought = await Thought.findByIdAndUpdate(
thoughtId,
{ $inc: { hearts: 1 } }, // Increment hearts by 1
{ new: true } // Return the updated document

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread server.js
Comment on lines +86 to +105
// GET /endpoints - Documentation
app.get("/endpoints", (req, res) => {
const apiDocumentation = [
{
path: "/",
methods: ["GET"],
middleware: ["anonymous"],
},
{
path: "/thoughts",
methods: ["GET", "POST"],
middleware: ["anonymous"],
},
{
path: "/thoughts/:thoughtId/like",
methods: ["POST"],
middleware: ["anonymous"],
},
];
res.status(200).json(apiDocumentation);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

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