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
What is a status code 202?
this means that the request was valif and its processing will finish sometime in the future
What is a status code 308?
What code would you use if an update didn’t return data to a client?
the 400’s
What code would you use if a resource used to exist but no longer does?300’s
What is the ‘Forbidden’ status code?
403
Video Notes
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
What is middleware?
code that runs but before it goes to our routes
What does app.use(express.json()) do?
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
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
How do you make a defalut value in a schema?
default.whatever you want it to be
What does a 500 error status code mean?
there is an error on the server. it means our error occured not the client.
What is the difference between a status 200 and a status 201?
201 means succesfully an object and 200 means everything works.