express Flashcards

1
Q

How do you add express to your package dependencies?

A

you use:

npm install express

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

What Express application method starts the server and binds it to a network PORT?

A

app.listen(x)

x is the designated port

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

What does the express.json() middleware do and when would you need it?

A

parse incoming request with json payloads.

it is used when the content type header matches content type

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

What does express.static() return?

A

its a middleware function

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

What is the local __dirname variable in a Node.js module?

A

it is the name of the directory that you are currently in

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

What does the join() method of Node’s path module do?

A

it joins all given path segments methods together and returns it into a string.

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