express intro Flashcards
How do you add express to your package dependencies?
npm install you simply install it on the terminal
What Express application method starts the server and binds it to a network PORT?
listen() method
How do you mount a middleware with an Express application?
you call the use() method on the app express application and pass it one argument and/optional a callback function expecting at least two parameters req and res and the optional of next
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
the request object req, and the response object res,
What is the appropriate Content-Type header for HTTP messages that contain JSON in their bodies?
application/json
What is the significance of an HTTP request’s method?
it indicates the desires action to be performed for a given resource
What does the express.json() middleware do and when would you need it?
it parses a raw jason string body into an object??????????????//