CRUD
Reading
- In your own words, describe what each group of status code represents:
- 100’s = for information only, like if the server can’t accommodate what the client is asking.
- 200’s = success codes, tells the client the request was accepted.
- 300’s = these tell the client that the information they want is no longer available there, and redirects them.
- 400’s = error codes.
- 500’s = error codes, but for the server.
- What is a status code 202?
the request met all validation requirements at the time of sending
- What is a status code 308?
This tells the client to use another URL to access the resource and not use the current URL anymore.
- 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
- What is the ‘Forbidden’ status code?
The client has authorized or doesn’t need to authorize itself, but still has no permissions to access the resource.
Videos
Why do we need to pull our MongoDB database string out of our server and put it into our .env?
because you won’t use the localhost when it’s on another computer/server.
- What is middleware?
it’s code that runs after a request was passed, but before it gets to the route.
- What does
app.use(express.json())
do?
this lets the server accept json as a body
- What does the
/:id
mean in a route?
a parameter the client passes to the sever, you can access it through request.params.id
which allows you to access whatever they pass after that /
.
- What is the difference between
PUT
andPATCH
?
put updates the whole object, patch only updates whatever gets passed from the client.
- How do you make a default value in a schema?
by writing default
inside a schema and then using the value/function you want as a value
- What does a
500
error status code mean?
the server had an internal error
- What is the difference between a status
200
and a status201
?
200 means the request was successful, but 201 says the create request was successful.
301 | Home |
---|---|
read01 | Introduction to React and Components |
read02 | State and Props |
read03 | Passing Functions as Props |
read04 | React and Forms |
read05 | Putting it all together |
read06 | NODE.JS |
read07 | REST |
read08 | APIs |
read09 | FUNCTIONAL PROGRAMMING |
read10 | In memory storage |
read11 | Authentication |
read12 | Mongo and Mongoose |
read13 | CRUD |
read14 | Project Ideas |
read15 | Project Kickoff |