reading-notes

Status Codes Based on REST Methods

  1. In your own words, describe what each group of status code represents: 100’s = its telling you the request will fail before it starts sending the body 200’s = this means success! all the requirements were meant and its gonna be alright 300’s = this status code tell the client that what they were looking for is not there anymore 400’s = this means that there is something wrong on the client side. for example wrong URI or missing authentication 500’s = error codes like an unreachable server
  2. What is a status code 202?
  1. What is the ‘Forbidden’ status code? 403

Video Notes

  1. Why do we need to pull our MongoDB database string out of our server and put it into our .env?
    • We want to use something that isn’t our localHost when we deploy
  2. What is middleware? code that runs but before it goes to our routes
  3. What does app.use(express.json()) do?

  4. What does the /:id mean in a route? its a paramater that we can access that we can access by using request.params. it gives us acess to whatever they put after the slash
  5. What is the difference beween PUT and PATCH? because we only want to udpdate what they give us. if we use put it will update everything instead of what they just give us
  6. How do you make a defalut value in a schema? default.whatever you want it to be
  7. What does a 500 error status code mean? there is an error on the server. it means our error occured not the client.
  8. What is the difference between a status 200 and a status 201? 201 means succesfully an object and 200 means everything works.