View on GitHub

reading-notes

read 13

CRUD

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

  1. 100’s = header part of the request has been received and the server will try to comply with a transmission demand of the client
  2. 200’s = These are the success They tell the client thacodes. t its request was accepted.
  3. 300’s = They tell the client that the resource they are requesting isn’t available at the expected location anymore.
  4. 400’s = These are the client error codes. They are all about invalid requests a client sent to a server.
  5. 500’s = server error codes

What is a status code 202?

ACCEPTED : This code tells the client that the request was valid,

What is a status code 308?

Permanent Redirect - 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 No Content

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

414 Request-URI Too Long - This is sometimes the case when the endpoint is right, and the resource exists, but the query makes the URL too long to be interpreted.

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.

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

I think to can be access in the heroku.

What is middleware?

Middleware is software that provides common services and capabilities to applications outside of what’s offered by the operating system.

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

is a method inbuilt in express to recognize the incoming Request Object as a JSON Object. This method is called as a middleware in your application using the code: app

What does the /:id mean in a route?

It’s mean a key of object which you are shown in the database and declared by default.

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.

What is the difference beween PUT and PATCH?

The main difference between the PUT and PATCH method is that the PUT method uses the request URI to supply a modified version of the requested resource which replaces the original version of the resource, whereas the PATCH method supplies a set of instructions to modify the resource.

How do you make a defalut value in a schema?

You can also set the default schema option to a function. Mongoose will execute that function and use the return value as the default.

What does a 500 error status code mean?

Error in the HTTP. “SERVER ERROR”

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).

Things I want to know more about