Skip to content

Latest commit

 

History

History
86 lines (38 loc) · 2.11 KB

File metadata and controls

86 lines (38 loc) · 2.11 KB

Readings: CRUD

In your own words, describe what each group of status code represents:

  • 100’s = informational statatus code that tells the client the header part of the reqest has been received.

  • 200’s = success codes

  • 300’s = redirection codes

  • 400’s = client error codes, something is wrong on the client end

  • 500’s = server error code, back end issues

  • What is a status code 202?

    • Accepted, asynchronous processing. This code tells the client that the request was valid, but its processing will finish sometime in the future
  • What is a status code 308?

    • Permanent Redirect - This is the right code if the resource will now be available at a new URL and the client should directly access it via the new URL in the future
  • What code would you use if an update didn’t return data to a client?

    • 204
  • What code would you use if a resource used to exist but no longer does?

    • 410 gone
  • What is the ‘Forbidden’ status code?

    • 403

Videos

Build A REST API With Node.js, Express, & MongoDB - Quick - First 20 minutes

Why do we need to pull our MongoDB database string out of our server and put it into our .env?

  • const mongoose // mogoose.connect // const.db = mongoose.connection

What is middleware?

  • oftware that lies between an operating system and the applications running on it

What does app.use(express.json()) do?

  • accpt json as a body

What does the /:id mean in a route?

  • parameter we can access by using params

What is the difference between PUT and PATCH?

  • pu will use all in for patch will only use a part of the information

How do you make a default value in a schema?

  • default: date.now

What does a 500 error status code mean?

  • internal server error

What is the difference between a status 200 and a status 201?

  • 200 ok 201 created

Things I want to know more about...