Express Flashcards

1
Q

What is

Express

A

Express is a web framework built on top of Node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does Express provide?

A

Ways to:
* Write handlers for HTTP requests (routes)
* Integrate with view-rendering engines
* Add “middleware” within the request handling pipeline.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are middleware functions used for?

A

Middleware functions are used to pre-process incoming requests and outgoing responses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are middleware functions defined as?

A

Middleware functions are defined as functions that take request, response, and a next handler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is

Axios

A

A JavaScript library that is used to generate HTTP requests and receive/parse the responses from the Express web server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What kind of interface does Axios use?

A

Axios uses a promise-based interface.
* Every Axios request must return a promise.
* The promise is resolved when the response arrives.
* Use then or async/await to handle Axios requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The intended Axios API is ?-based.

A

The intended Axios API is constructor-based.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In Express,

What does a route define?

A

A route defines the type of HTTP message that the server is waiting for.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In Express,

What does a route contain?

A

A route contains a callback function that controls how the server responds when a message arrives (that matches one of the defined routes).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the

2 Primary Components of a Route

A
  • Method
  • Path
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Route Definition: HTTP Method

A

The HTTP Method defines the type of request being sent to a server and how the server should handle it.

It determines what action is performed on the route.

Examples: GET, POST, HEAD, PUT, DELETE, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Route Definition: Path

A

The Path is the string or pattern that defines the URL to match.

It is the first parameter passed to a route method.

Examples: String route, String pattern route, Regex route

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Route Definition: Handlers

A

The Handler is a callback function that is triggered when an HTTP request that matches the route arrives at the web server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is an

Instance of Express

A

app:
app.Method(PATH, HANDLER)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly