“Accepted” It tells the client that the request was valid and it is processing and that will finish some time in the future. Often used for asyncronous processing.
“Permanent Redirect” If the URL is changing it informs the client where the information will be found in the future.
204 no content
If it’s not just a redirect, and I don’t know where to find said resource 410- gone.
403
Having entered the .env into the gitignore putting the MongoDB string in the .env protects it from being public.
Code that runs when the server gets a request but before the information gets passed through the routes.
It allows the server to accept json as a body inside a post element.
The colon specifies that the route is looking for the parameter ‘id’.
Patch replaces only what it is given, put replaces everything.
Each SchemaType that you define (you can read more about them in the model definition chapter ) can have a default value.
Default values are applied when the document skeleton is constructed. This means that if you create a new document (new MyModel) or if you find an existing document (MyModel.findById), both will have defaults provided that a certain key is missing. https://mongoosejs.com/docs/2.7.x/docs/defaults.html
Server error.
200 is “sucess” while 201 is more specific to say “you’ve successfully created an object”