Express Flashcards
What is a client?
program or device that sends requests
what is a server?
program or device that receives requests from clients and sends back a response
HTTP method when. you visit a url
GET
first line of an HTTP request message?
The method protocol, target and version
first line of an HTTP response message?
protocol, version status code and status message
HTTP headers
metadata
is the body required for a valid HTTP message?
nope
what is NPM
NPM is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently.
npm consists of three distinct components:
• the website
• the Command Line Interface (CLI)
• the registry
What is a package in npm
files of. code and it includes a package.json
create a package.json with npm
npm init –yes
What is a dependency and how to you add one to a package?
something that your code depends on. You add by npm install
what happens when you install a dependency with npm?
adds another module in your directory and is assigned to the json file as a dependency
What express application method starts the server and binds it to a network PORT?
app.listen(path, [callback])
how to you mount a middleware with an Express application?
the use method
What objects does an Express application pass to your middleware to manage the request/response lifecycle of a server?
request and response objects