Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Week2 #13

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Week2 #13

wants to merge 2 commits into from

Conversation

Nihan2019
Copy link

No description provided.

@dfdeagle47
Copy link
Owner

Looks pretty good. Here's my feedback

  • GET /posts: nothing to say, works as expected :).
  • GET /posts/:postId: good use of the Array.find method. For the return value in the res.send method, you should use the post itself (as a JavaScript object) instead of sending an HTML string. REST API normally just send the raw data as JavaScript objects (in JSON). The raw data is then formatted in HTML properly on the client-side (in the next module, you will see how to do this using React).
  • GET /posts/:postId/delete : the goal of this route is to remove a post from the array. You should take a look at the array methods which would help you do this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array.

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