Express Flashcards
What is Express useful for?
It helps manage servers and routes/end-points
How does Express fit into a full-stack web application?
Serves as a middle man for front and back end
How do you add express to your package dependancies?
npm install express
What Express application method starts the server and binds it to a network PORT?
listen()
What do port numbers refer to?
Specific port numbers are often used to identify specific services.
What is Express middleware?
What is Express middleware useful for?
It is useful for carrying out actions for a request coming in and a response going out
How do you mount a middleware with an Express application?
app.use()
Which objects does an Express application pass to your middleware to manage the request/response lifecycle of the server?
err, req, res, next
Whats does app.use do?
Installs the middle ware
What is an API endpoint?
A URL (uniform resource locator)
What is he appropriate Content-Type header for HTTP messages that JSON
application/json
What is the significance of an HTTP request’s method?
Lets you know what you’re doing
What does the express.json() middleware do and when would you need it?
express.json() method is used to parse the incoming requests with JSON payloads
What is the purpose of the Express Static middleware?
To add middleware for serving static files to your Express app