This is my reading notes for Code Fellows.
1)in your own words, describe what each group of status code represents: 100’s = items in progress 200’s = successful response 300’s = re-direct 400’s = browser error/client error 500’s = Server error
2) What is a status code 202?
Accepted
3)What is a status code 308?
Permanent Redirect
4)What code would you use if an update didn’t return data to a client?
204
5)What code would you use if a resource used to exist but no longer does?
410
6)What is the ‘Forbidden’ status code?
403
1) Why do we need to pull our MongoDB database string out of our server and put it into our .env?
in order to access the data base,
2)What is middleware?
Middleware is software that provides common services and capabilities to applications outside of what’s offered by the operating system.
3)What does app.use(express.json()) do?
The express. json() function is a built-in middleware function in Express. It parses incoming requests with JSON
4)What does the /:id mean in a route?
Route parameters are named URL segments that are used to capture the values specified at their position in the URL. The captured values are populated in the req.params object, with the name of the route parameter specified in the path as their respective keys.
5)What is the difference beween PUT and PATCH?
PUT is a method of modifying resource where the client sends data that updates the entire resource . PATCH is a method of modifying resources where the client sends partial data that is to be updated without modifying the entire data.
6)How do you make a defalut value in a schema?
Your schemas can define default values for certain paths. If you create a new document without that path set, the default will kick in.
7)What does a 500 error status code mean?
Internal Server Error server error
8) What is the difference between a status 200 and a status 201?
The 200 status code is by far the most common returned. It means, simply, that the request was received and understood and is being processed. A 201 status code indicates that a request was successful and as a result, a resource has been created (for example a new page).