reading-notes

Software Development Reading Notes

View on GitHub

Readings: CRUD

Status Codes Based On REST Methods

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

What is a status code 202?

The request has been accepted.

What is a status code 308?

Permanent Redirect.

What code would you use if an update didn’t return data to a client?

400

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

301

What is the ‘Forbidden’ status code?

404

Build A REST API With Node.js, Express, & MongoDB

so DB is not hard coded and also .env provider a secure layer.

code that runs when the server get request and before pass to routes.

let our server accept json as a body instead of a post/get element

PUT handles updates by replacing the entire entity, while PATCH only updates the fields that you give it.

by define inside the schema method

server side error code

200: OK. The standard response for successful HTTP requests. 201: Created. The request has been fulfilled.