My reading journal for Code Fellows.
The 202 status means Accepted.
308 status code is for a permanent redirect
204 (No Content) should be sent when no data is returned.
204 (No Content) should be sent upon a successful deletion.
403 (Forbidden) is returned when the client has proper authorization but can’t access the resource.
The database address should be stored in .env because it can change based on your deployed environment.
Middleware is any code that runs after the server gets a request, but before it is passed to the routes.
It allows the server to accept json data as a body.
It represents one or more parameters that can be accessed in the request.
PUT updates all information at once. PATCH updates only the information that was passed.
A default value can be set by creating the default:
property and assigning it your default value.
The 500 status code means that there was an error with the server and it has nothing to do with the client.
Code 200 means OK and Code 201 means Created. 201 should be sent instead of 200 whenever you are creating something because it is a more specific status code that better represents the results.
I want to continue learning more about RESTful code and how to use it with APIs. It is really cool to start seeing how REST allows different actions to be taken and I’m looking forward to furthering my understanding.