Reading Notes
2.The route handler is middleware: False, functions that only use req & res are simply handlers.
3.How can a middleware end a function and send data to the client?
4.At what point in the request lifecycle can you “inject” middleware?
5.What causes: “Request headers sent twice, cannot start a second response”?
Middleware a function that acts on a client request before being received by the route handler
Request Object The request object is used to capture information from the client and deliver it to the server at the time of a client request
Response Object The response object provides the return information that is sent back to the client from the server
Application Middleware A piece of software that intercepts an incoming request prior to hitting its target route. It can perform additional processing, make changes to the request, or reject the request.
Test Driven Development A development model where tests are written before the solution code to help guide and constrain the solution
Behavioral Testing AKA Black Box Testing, tests software by applying inputs and assessing the outputs
class Rectangle {
constructor (height, width) {
this.height = height;
this.width = width;
})
}
Class declarations are not hoisted
Class Expressions
let Rectangle = class Rectangle2 {
constructor(height, width) {
this.height = height;
this.width = width;
}
}
super
keyword can be used to call the constructor of the super classextends
keyword used to create a class as a child of another class